-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always purge all but one incomplete backups #778
base: master
Are you sure you want to change the base?
Conversation
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly we're not there yet.
I've tested this and incomplete backups remain after a purge.
Before:
medusa-test-dc1-schedule-1719391860 (started: 2024-06-26 08:51:16, finished: 2024-06-26 08:51:27)
medusa-test-dc1-schedule-1719391920 (started: 2024-06-26 08:52:16, finished: 2024-06-26 08:52:26)
medusa-test-dc1-schedule-1719391980 (started: 2024-06-26 08:53:16, finished: 2024-06-26 08:53:27)
medusa-test-dc1-schedule-1719392040 (started: 2024-06-26 08:54:16, finished: 2024-06-26 08:54:26)
medusa-test-dc1-schedule-1719392100 (started: 2024-06-26 08:55:15, finished: 2024-06-26 08:55:27)
medusa-test-dc1-schedule-1719392160 (started: 2024-06-26 08:56:15, finished: 2024-06-26 08:56:26)
medusa-test-dc1-schedule-1719392220 (started: 2024-06-26 08:57:15, finished: 2024-06-26 08:57:26)
medusa-test-dc1-schedule-1719392280 (started: 2024-06-26 08:58:15, finished: 2024-06-26 08:58:27)
medusa-test-dc1-schedule-1719392340 (started: 2024-06-26 08:59:16, finished: 2024-06-26 08:59:26)
my-backup1 (started: 2024-06-26 09:00:28, finished: Incomplete [1 of 3 nodes finished])
my-backup2 (started: 2024-06-26 09:00:52, finished: Incomplete [1 of 3 nodes finished])
my-backup3 (started: 2024-06-26 09:01:16, finished: Incomplete [1 of 3 nodes finished])
After purge (with a max_backup_count
of 10):
medusa-test-dc1-schedule-1719391980 (started: 2024-06-26 08:53:16, finished: 2024-06-26 08:53:27)
medusa-test-dc1-schedule-1719392040 (started: 2024-06-26 08:54:16, finished: 2024-06-26 08:54:26)
medusa-test-dc1-schedule-1719392100 (started: 2024-06-26 08:55:15, finished: 2024-06-26 08:55:27)
medusa-test-dc1-schedule-1719392160 (started: 2024-06-26 08:56:15, finished: 2024-06-26 08:56:26)
medusa-test-dc1-schedule-1719392220 (started: 2024-06-26 08:57:15, finished: 2024-06-26 08:57:26)
medusa-test-dc1-schedule-1719392280 (started: 2024-06-26 08:58:15, finished: 2024-06-26 08:58:27)
medusa-test-dc1-schedule-1719392340 (started: 2024-06-26 08:59:16, finished: 2024-06-26 08:59:26)
my-backup1 (started: 2024-06-26 09:00:28, finished: Incomplete [1 of 3 nodes finished])
my-backup2 (started: 2024-06-26 09:00:52, finished: Incomplete [1 of 3 nodes finished])
my-backup3 (started: 2024-06-26 09:01:16, finished: Incomplete [1 of 3 nodes finished])
def backups_to_purge_by_completion(backups): | ||
complete, incomplete = [], [] | ||
for backup in backups: | ||
complete.append(backup) if backup.finished is not None else incomplete.append(backup) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue: This doesn't work the expected way I think. Here, the completeness of the backup is checked for the local node only (we're dealing with a NodeBackup, not a ClusterBackup).
Hence, any incomplete ClusterBackup would still be considered a complete backup for the purge process.
Remember that the purge is done locally for a node, it's not a global operation and has to run on each node.
Fixes #607