Skip to content

Conversation

@rzvoncek
Copy link
Contributor

Fixes #607

@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@rzvoncek rzvoncek requested a review from adejanovski June 20, 2024 08:52
Copy link
Contributor

@adejanovski adejanovski left a 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)
Copy link
Contributor

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.

@rzvoncek rzvoncek force-pushed the radovan/keep-valid-backups-2 branch from 34340c4 to 82bca49 Compare February 7, 2025 10:33
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 7, 2025

@rzvoncek
Copy link
Contributor Author

rzvoncek commented Feb 7, 2025

The 3 failures in the CI are getting fixed in #849.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

max_backup_count should keep valid backups

3 participants