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

Which operations are safe to control-c? #8690

Open
greatericontop opened this issue Mar 18, 2025 · 3 comments
Open

Which operations are safe to control-c? #8690

greatericontop opened this issue Mar 18, 2025 · 3 comments

Comments

@greatericontop
Copy link

greatericontop commented Mar 18, 2025

(This is half question and half suggestion. Sorry for double-posting this on the IRC.) A few days ago, I was running borg compact and had to control-C it. I ran it again, and it output a bunch (like 20) of "segment xxx not found, but listed in compaction data". Judging from this issue, it seems like it has something to do with corruption (maybe from interrupting the earlier borg compact). However, after running borg check --verify-data, all the verification passed.

Question part: Does this mean my repo & archives are good and not corrupted? Or does the borg check not check the missing segments and my repo might still be broken?

Suggestion part: I think it would be helpful to other users to explicitly list "safe to control-C" or "unsafe to control-C" for each command. (Currently, the only mention of interrupt safety is that it's safe to interrupt archive creation.)

@ThomasWaldmann
Copy link
Member

AFAIK, all operations of borg 1.x are safe to Ctrl-C.

borg 1.x works transaction-based, so if something breaks in the middle, it rolls the repo back to the previous commit.

borg compact might be a bit different though as it is shuffling data from old segment files into new segment files and then deleting the old segments, so there won't be a complete rollback to the previous state. But it does this in a way so that no data can be lost (only deleting the old stuff after the new stuff has been written / committed).

The guy in #5120 had major hw or OS issues, so that's not a good reference.

About segment xxx not found, but listed in compaction data:

That can be a cosmetic issue: borg maintains a "hints" file that contains compaction information, pointing to segments files that are candidates for compaction.

borg emits that warning if the segment xxx is not there anymore (could be due to a compaction when the hints file was not updated, could be due to a fs issue when the file was lost). If borg check --verify-data says everything is fine, then there is no problem. Guess borg check --repair rewrites a "clean" hints file.

@greatericontop
Copy link
Author

If I'm reading that correctly, it seems like the first borg compact just deleted the segments without updating the hints file, but everything is fine?

@ThomasWaldmann
Copy link
Member

Yes. Either that or there was some other / previous issue updating the hints file.

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

2 participants