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

interrupted borg compact / compact_segments #6899

Closed
ThomasWaldmann opened this issue Jul 28, 2022 · 2 comments · Fixed by #8332
Closed

interrupted borg compact / compact_segments #6899

ThomasWaldmann opened this issue Jul 28, 2022 · 2 comments · Fixed by #8332
Milestone

Comments

@ThomasWaldmann
Copy link
Member

Discussed in #6283

Originally posted by sophie-h February 11, 2022

Will borg compact in borg 1.2 be able to continue where it was left off?

I'm currently trying to prune hundreds of archives but there does not seem to be an easy way to complete this.

@ThomasWaldmann
Copy link
Member Author

ThomasWaldmann commented Jul 28, 2022

compaction copies valid entries from old source segment files to new target segment files, skipping over the logically deleted stuff.

i had a look at the code and complete_xfer is called when a target segment is full and then adds an intermediate commit to it and also gets rid of all (at that point) completely unused source segment files.

at the end of the compaction complete_xfer is called unconditionally and will add a final commit.

the index files are only written at the very end of the whole process, guess this needs some review whether that is ok.

@ThomasWaldmann
Copy link
Member Author

for cases when borg compact could take rather long (e.g. after deleting lots of archives in one borg delete/prune command), it might be a good idea to slowly step-by-step lower the compaction threshold, so it has less to do per compaction run.

an alternative approach is to avoid mass-deletion of archives and only delete/prune a few archives, then borg compact, then delete next few, etc.

in general, users are advised to run borg prune frequently (like daily or weekly) - it is a rather bad idea to first accumulate hundreds or thousands of archives in a repo and then wanting to get rid of most of them all at once.

@ThomasWaldmann ThomasWaldmann added this to the 1.2.2 milestone Jul 28, 2022
@ThomasWaldmann ThomasWaldmann modified the milestones: 1.2.2, 1.2.3 Aug 6, 2022
@ThomasWaldmann ThomasWaldmann modified the milestones: 1.2.4, 1.2.5 Mar 12, 2023
@ThomasWaldmann ThomasWaldmann modified the milestones: 1.2.5, 1.2.6 Jun 27, 2023
@ThomasWaldmann ThomasWaldmann modified the milestones: 1.2.7, 1.2.8 Sep 25, 2023
@ThomasWaldmann ThomasWaldmann modified the milestones: 1.2.8, 1.4.x Feb 24, 2024
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.

1 participant