Skip to content
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

Backup retention interval is unstable #38

Closed
Urth opened this issue Aug 31, 2020 · 0 comments
Closed

Backup retention interval is unstable #38

Urth opened this issue Aug 31, 2020 · 0 comments

Comments

@Urth
Copy link
Member

Urth commented Aug 31, 2020

The interval between backups in the same retention period is unstable. For example when a daily backup is selected as the best candidate for a weekly retention period it does not consider the previous weekly backup. As a result the interval between weekly backups can vary between 6-8 days.

Select planb-20200622T0014Z as fresh match for 20200621T0013Z (planb.storage.base)
Select planb-20200621T0004Z as best match for 20200621T0013Z with diff:540 (planb.storage.base)
Select planb-20200614T0005Z as best match for 20200614T0004Z with diff:-60 (planb.storage.base)
Select planb-20200609T0012Z as best match for 20200607T0005Z with diff:-173220 (planb.storage.base)
Select planb-20200604T0012Z as best match for 20200602T0012Z with diff:-172800 (planb.storage.base)

Because planb-20200622T0014Z is the closest it will be preserved and cause planb-20200621T0004Z to be removed even though it is the perfect match compared to the previous backup planb-20200614T0005Z.

@Urth Urth closed this as completed in ac71f8b Sep 2, 2020
Urth added a commit that referenced this issue Sep 2, 2020
Fix #38 by always clamping dates to a sane value for the given period.
Previously the targetted desired date for a given retention period would
depend on the day the backup was performed. As a result it shifted each
day by one day causing unstable intervals in between.

So a weekly retention period interval could be vary between 6 to 8 days.
For example weekly backups are now clamped to sundays (hardcoded, #39)
and as a result the best matching snapshot no longer shifts day by day.

This uses dateutil to perform the weekday clamping.
Add Django 3.1 as a supported version in the setup requirements.
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

No branches or pull requests

1 participant