find: List missing pack files based on the index#3427
Merged
fd0 merged 6 commits intorestic:masterfrom Jul 30, 2021
Merged
Conversation
891a270 to
fc0cb2a
Compare
Just passing the list of blobs to packsToBlobs would also work in most cases, however, it could cause unexpected results when multiple pack files have the same prefix. Forget found prefixes to prevent this.
If a pack file is missing try to determine the contained pack ids based on the repository index. This helps with assessing the damage to a repository before running `rebuild-index`.
fc0cb2a to
3442dc8
Compare
fd0
approved these changes
Jul 30, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR change? What problem does it solve?
When some pack files where lost, it would be useful to know which files/snapshots were affected without having to rebuild the index first. Currently
restic find --pack <pack-id>returns nothing even if the pack file is still contained in the repository index. This PR introduces a fallback to resolve the blobs contained in a pack files from the repository index.It is now also possible to specify multiple pack files in a single
restic find --packcall.Was the change discussed in an issue or in the forum before?
https://forum.restic.net/t/missing-packs-not-found/2600
Checklist
- [ ] I have added documentation for the changes (in the manual)changelog/unreleased/that describes the changes for our users (template here)gofmton the code in all commits