-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
restic optimize does not delete unreferenced packs #359
Comments
Thanks for the report, this is clearly a grave bug, the optimize command should never break the repository. |
I tried to reproduce the issue with debug logging enabled but failed (partially):
Is the assumption correct, that optimize should remove the unrefered pack? |
Oh yes, that's indeed a bug. Can you please run |
... returned nothing. But wasn't this expected? Doesn't the error message tell quite clearly that the pack is not referenced in any index? Think you'll have to explain in more detail... But: The debug log attached to #358 (comment) indicates that the pack contains blobs
|
Here are the files these blobs belong to:
|
What I'd really like to find out it why running optimize caused more unreferenced packs to appear. That's really strange, I'm not able to reproduce it. |
Me neither. This time "only" the one unreferenced pack remains. Sadly I deleted the initial repo in order for a new run with debug logging enabled. I could start over again with a refresh repo. With some luck this allows me to reproduce the initial error... |
Hm. I'll have a look at the optimize code again this weekend, to see if I can spot anything that might lead to such a bad result. |
Well, I started over twice with the following results:
Conclusion: I would consider this issue as initially reported unreproduceable. You could rename the issue to "restic optimize does not delete unreferenced packs". |
I looked up in my shell's history, the exact commands I executed monday morning: check, unlock, check, optimize, check. I forgot to write about the unlock. I cannot explain why the first check failed to lock the repository. I'm quite sure that no other restic instance was running, but who knows... it was early monday morning... |
I've updated the title. Do you think there is a different issue that the one described in #358? Or should we close this one for now? |
I think both issues are still different: #358 causes unreferenced packs, where as this issue is about optimize not cleaning them up. |
Ok, I'll have a look. |
As an additional note, it is a bit disturbing that "restic check" considers that having unreferefenced packs means that "the respository has errors". It does not seem like an error to me; maybe it could just point to optimize. |
Good point, thanks. |
The |
Restic version: restic 0.1.0 (v0.1.0-147-g867fc5b), compiled at 2015-11-21 09:32:12 with go1.5.1
Observed behavior: applying
restic optimize
to the repository with a single "pack not referenced in any index" error from #358 broke the repository:restic check
now reports numerous "pack not referenced in any index" errors. Numerous means, that the output does not fit in my screen scrollback buffer (5000 lines)!I did not try to restore from that repo.
Expected behavior: The initial "pack not referenced in any index" is gone.
Steps to reproduce: See #358
The text was updated successfully, but these errors were encountered: