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

Backups not being deleted as expected #937

Open
a-thomas-22 opened this issue Oct 16, 2023 · 2 comments · May be fixed by #938
Open

Backups not being deleted as expected #937

a-thomas-22 opened this issue Oct 16, 2023 · 2 comments · May be fixed by #938

Comments

@a-thomas-22
Copy link

Script does not delete old backups due to the LEFT check

Description:

When running the backup script on a weekly basis (via cron schedule 0 0 * * 0), the older backups are not getting deleted as expected. The core issue lies in the LEFT check in combination with the BACKUP_NUM_TO_RETAIN value.

Steps to Reproduce:

  1. Set BACKUP_NUM_TO_RETAIN to 4.
  2. Run the script weekly.
  3. Observe that after 5 weeks, there are 5 backups and none of the older backups have been deleted.

Expected Behavior:

After the number of backups surpasses the BACKUP_NUM_TO_RETAIN value, the oldest backups that exceed this count and are older than the DAYS_TO_RETAIN threshold should be deleted.

Actual Behavior:

Older backups are never deleted, regardless of their age, due to the LEFT check. Since we're only creating 1 backup per week and DAYS_TO_RETAIN is set to 4 days, the condition for deletion is never met.

@creckord
Copy link

See also issue #425. Not sure if the suggested change over there still applies after the changes from #938.

@a-thomas-22
Copy link
Author

a-thomas-22 commented Jun 7, 2024

I made a sidecar workaround for kubernetes until a PR to fix is made for those of us having this issue
https://github.com/a-thomas-22/wal-g-pruner

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 a pull request may close this issue.

2 participants