check --repair: rebuild a corrupt repository index from the packs, #10026 - #10048
Open
mr-raj12 wants to merge 1 commit into
Open
check --repair: rebuild a corrupt repository index from the packs, #10026#10048mr-raj12 wants to merge 1 commit into
mr-raj12 wants to merge 1 commit into
Conversation
…rgbackup#10026 Verify each pack's sha256 and rebuild the chunks index from the intact packs' object headers, then persist it. Chunks that exist only in corrupt packs are dropped; salvaging them is not implemented yet.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10048 +/- ##
==========================================
+ Coverage 86.61% 86.64% +0.02%
==========================================
Files 97 97
Lines 16912 16942 +30
Branches 2550 2557 +7
==========================================
+ Hits 14649 14680 +31
+ Misses 1571 1570 -1
Partials 692 692 ☔ View full report in Codecov by Harness. |
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.
A corrupt chunks index currently leaves a borg2 repo stuck:
Repository.check(repair=True)just logged "repository repair not implemented" and stopped. This implements the repository-level index repair from #10026.When the index is corrupt and
--repairis given, the index is now rebuilt from the packs and persisted:build_chunkindex_from_repogets anonly_packsfilter and a progress indicator for the rebuild.Left for follow-up work: pack salvage and reading the persisted corrupt-pack list (needs #9925), and keeping the rebuilt index across the archives check.
ArchiveChecker.finishstill deletes it, so a fullborg check --repairrebuilds again in the archives phase, while--repository-only --repairkeeps the persisted index.Tests cover rebuilding a corrupt index (every chunk gets indexed and resolves) and excluding a corrupt pack from the rebuild (its chunk is dropped, the intact pack's chunk is recovered).
Refs #10026.