Mike Percy has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/13405 )
Change subject: [backup] Add a tool to clean up old backups ...................................................................... [backup] Add a tool to clean up old backups This adds a tool that cleans up old backups. Eligibility for cleanup is a property of the backup path, not the actual backup. There are two conditions: 1. The path is not the restore path. 2. Every backup on the path is older than the expiration age, which the tool allows users to express in days. The default is 30 days. If a path satisfies both conditions, the tool will delete its backups, from most recent to least recent. This way, if the tool terminates mid-delete, the next run of the tool can pick up where the previous one left off. However, a backup on the restore path will not be deleted, even if it lies on a path that is expired. The tool has a dry run mode, a verbose mode, and a table name filter. It does not normally output anything on success. There are a couple of situations not currently handled by this tool: 1. Failed backups with no metadata. 2. Backup paths with no full backup at the beginning. This is because the backup graph abstraction doesn't presently handle these cases in a way the tool can use. The tool can be further improved after a follow up to enhance the backup graph. Change-Id: I4a4c4dde10ec3c3c9b2233ee2f7b13c46e963e39 Reviewed-on: http://gerrit.cloudera.org:8080/13405 Tested-by: Kudu Jenkins Reviewed-by: Mike Percy <[email protected]> --- M java/kudu-backup-tools/src/main/scala/org/apache/kudu/backup/BackupIO.scala A java/kudu-backup-tools/src/main/scala/org/apache/kudu/backup/KuduBackupCleaner.scala M java/kudu-backup-tools/src/test/scala/org/apache/kudu/backup/TestKuduBackupCLI.scala A java/kudu-backup-tools/src/test/scala/org/apache/kudu/backup/TestKuduBackupCleaner.scala A java/kudu-backup-tools/src/test/scala/org/apache/kudu/backup/TestUtils.scala M java/kudu-backup/src/main/scala/org/apache/kudu/backup/KuduBackup.scala M java/kudu-backup/src/test/scala/org/apache/kudu/backup/TestKuduBackup.scala 7 files changed, 337 insertions(+), 30 deletions(-) Approvals: Kudu Jenkins: Verified Mike Percy: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/13405 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4a4c4dde10ec3c3c9b2233ee2f7b13c46e963e39 Gerrit-Change-Number: 13405 Gerrit-PatchSet: 7 Gerrit-Owner: Will Berkeley <[email protected]> Gerrit-Reviewer: Grant Henke <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Mike Percy <[email protected]> Gerrit-Reviewer: Will Berkeley <[email protected]>
