Conversation
mr-raj12
force-pushed
the
check-repair-single-rebuild-10434
branch
from
September 27, 2026 22:19
c71248d to
468df82
Compare
This was referenced Sep 27, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10445 +/- ##
=======================================
Coverage 88.73% 88.74%
=======================================
Files 103 103
Lines 19387 19392 +5
Branches 3023 3025 +2
=======================================
+ Hits 17204 17209 +5
Misses 1514 1514
Partials 669 669 ☔ View full report in Codecov by Harness. |
This was referenced Sep 27, 2026
This branch has not been deployed
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.
Description
Merge after #10443. This branch is rebased on it and includes its commit; the first commit here is #10443's, the second is this PR's.
With a corrupt index, a full
borg check --repairrebuilt the index twice: once inRepository.checkand again inArchiveChecker.check, which rebuilds it from the packs on every--repairrun. Each pack was walked and each object decrypted twice, and an object failing validation was reported twice.Now:
--repairstill verifies every pack by its store hash, then leaves the corrupt index to the archives phase, which rebuilds and stores it. The repository check logs this and does not fail for it, unless it was interrupted (then the archives phase does not run and the check fails).--repository-only --repairis unchanged: it rebuilds the index if every pack is intact.Repository.checkrequiresrepo_onlyto be passed whenrepair=True, likevalidate.borg check --repair.Guard question from the issue: the "no rebuild if a pack is corrupt" guard now applies to
--repository-onlyonly, which is intended. A full--repairmay rebuild over a corrupt pack because its archives phase then repairs the archives that reference the dropped chunks.--repository-onlyhas no such step, so it leaves the index for a full repair (refs #8572). Left as is: under--repository-only, an object failing validation inside a pack whose store hash matches still gets a rebuild that skips it. That can be a follow-up if wanted.The total count of skipped pack byte ranges was not moved to the archives phase: each skip is logged with its pack and offset, and the archives check ends with "problems found".
Tests:
--repairwalks each pack once (fails on master with 51 extra walks)Repository.check(repair=True, repo_only=False)verifies all packs, walks no pack objects, stores no index and succeedsrepo-listaborts withCorruptChunkIndexFragment, and a second--repaircompletes--repository-onlymodefixes #10434
Checklist
master(or maintenance branch if only applicable there)toxor the relevant test subset)