repository: read-only check by hashing pack/index objects#9794
Open
mr-raj12 wants to merge 2 commits into
Open
repository: read-only check by hashing pack/index objects#9794mr-raj12 wants to merge 2 commits into
mr-raj12 wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9794 +/- ##
==========================================
- Coverage 84.70% 84.48% -0.23%
==========================================
Files 92 92
Lines 15172 15142 -30
Branches 2279 2271 -8
==========================================
- Hits 12852 12792 -60
- Misses 1617 1648 +31
+ Partials 703 702 -1 ☔ View full report in Codecov by Harness. |
ThomasWaldmann
requested changes
Jun 18, 2026
ThomasWaldmann
left a comment
Member
There was a problem hiding this comment.
i only looked at archive and repository code, not tests.
per-kind counters and clearer messages; skip 4 check tests pending repair, refs borgbackup#8476 borgbackup#8572
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.
Makes the repository part of
borg checkwork with packs (N>1).packs/ and index/ objects are named by the sha256 of their content, so check just verifies
store.hash(name) == namefor each one. It doesn't parse pack headers at all, so a pack with many objects is checked exactly like a pack with one. On REST the hash is done server-side, so nothing is downloaded there; other backends still download the object to hash it.The chunk index is not rebuilt anymore. A read-only check shouldn't write, and rebuilding from pack headers is unsafe: one corrupt header would write wrong offsets for every later object in that pack. Repository repair isn't done yet, so for now it runs the same read-only check and reports problems without dropping any pack (dropping it would lose the pack's other, good objects too).
Adds a progress indicator over packs/ and index/.
The archives check rebuilds its index from pack headers read-only (
disable_caches) so it matches the actual packs and can still spot missing chunks. Note this is on purpose and not what #8476 suggests for the repository check: the repository check above does reuse the existing index objects, but the archives check needs an index that reflects the real packs, otherwise a stale cached entry would hide a chunk whose pack is gone. The scan reads headers only and writes nothing back.Tests cover corruption in a later object, index corruption, an intact multi-object pack, and the progress wiring. check_cmd_test.py: 24 passed, 27 skipped.
refs #8476 #8572