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

Prune operations not cleared automatically from plan history (again) #530

Open
modem opened this issue Oct 25, 2024 · 4 comments
Open

Prune operations not cleared automatically from plan history (again) #530

modem opened this issue Oct 25, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@modem
Copy link

modem commented Oct 25, 2024

Describe the bug
The prune operation list should be cleared after 30 days, from what I understand, but in my case I have entries since early June.
This issue has already been addressed in the past in #248.

I wonder if the fix got lost, or if there's any issue in my repos, which has been created long time ago.

Screenshots
Here's a print screen from one of my repos:
image
Another one has even more entries.

Expected behavior
List of prune operation to show the ones done in the last 30 days.

Platform Info

  • OS and Architecture Docker on Intel CPU
  • Backrest Version 1.6.1 but seen also in 1.5.0.
@modem modem added the bug Something isn't working label Oct 25, 2024
@garethgeorge
Copy link
Owner

Interesting — seeing your point, I made a change here such that prune and check operations are kept for up to a year with the expectation that they’re typically run pretty infrequently (weekly or monthly).

I might need to either look at making this configurable, or doing some sort of sliding window e.g. “the last year OR up to 100 operations of a given type per repo”.

For a bit of context, the original reason for the change was to allow “last run” scheduling to work— it needs the retention to be long enough that it can find the last time the task ran to determine when to run again. The simple option I went with here was just to make this a year, but that’s perhaps too long.

In the meantime— I would recommend considering whether you really want to run prune and check daily. Perhaps a weekly cadence would work similarly well? But agree that I need to limit this.

@modem
Copy link
Author

modem commented Oct 29, 2024

Thanks for the context Gareth.
I have the prune operation scheduled every 7 days, but sometimes I need to trigger it manually when I'm running out of space. And since that data is gone already (not part of any snapshot), it makes sense to me to clean the occupied space.
I don't have a good understanding on the scheduling, but for me the last run makes sense to be done based on the last backup operation.
I also don't see a reason to keep a long prune history, it brings no added value in the long run... Maybe it could be linked with a new system operations prune policy, defined per plan...

@garethgeorge
Copy link
Owner

Agree -- your use case / way of configuring it is definitely a valid one, just very different from the policies I use so I hadn't considered it :)

The scheduling logic is based on the last operation of a given type to ensure operations aren't skipped, so I think I need to update the garbage collection to just do some grouping by repo, plan, and type, and keep the latest of each (or something of that sort).

@garethgeorge
Copy link
Owner

Put together #555 to address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants