forked from yugabyte/yugabyte-db
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLAT-6231][K8s] update log_cleanup.sh to recover from full disk
Summary: The log_cleanup.sh was trying to compress the log files, and was failing with 'No space left on device'. This commit makes changes to recover from such state. - Old core dump files are deleted first before cleaning up the logs. - In case gzip fails on a file, we still continue with our cleanup. - We first delete the gz files, and then start deleting the non-gz files if we are still over the limit. - The current log files which are not rotated are still kept as they are. - This commit also changes the interpreter to Bash, and changes the rest of the script accordingly for consistency. Test Plan: I created dummy 4GiB log files in the logs directory of a master pod. And there was no space left on the device. - The script was able to iterate through all the files, it tried to gzip them. - It deleted the gz files first and then deleted those dummy large log files. - Inspected the output of script with set -x, rest of the parts seems to be working as expected. Command used to create dummy log files: ``` dd if=/dev/zero of=dummy_log_file bs=1M count=100 mv dummy_log_file yb-master.yb-master-0.root.log.WARNING.20221208-test1.20 ``` Reviewers: sneelakantan, sanketh Reviewed By: sanketh Subscribers: yugaware Differential Revision: https://phabricator.dev.yugabyte.com/D21835
- Loading branch information
Showing
1 changed file
with
108 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters