Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10467 +/- ##
==========================================
- Coverage 89.12% 89.11% -0.01%
==========================================
Files 103 103
Lines 19783 19783
Branches 3099 3099
==========================================
- Hits 17631 17630 -1
- Misses 1490 1492 +2
+ Partials 662 661 -1 ☔ View full report in Codecov by Harness. |
4 tasks done
mr-raj12
force-pushed
the
store-cache-check-10397
branch
from
October 5, 2026 05:40
925c8c9 to
32213b9
Compare
Contributor
Author
|
Rebased on current master, one conflict in the |
34 of 43 tasks
…ore cache, fixes borgbackup#10397 The cached packs (BORG_STORE_CACHE) are not verified against the repository. With the cache, check verified the cached copies instead of the repository: a damaged cache file was reported as an integrity error and check --repair deleted the intact object from the repository, while damage in the repository was not found as long as an intact copy was cached. repo-compress copies objects that already use the target compression into the new pack without authenticating them, so a damaged cache file ended up in the repository. Repository(store_cache=False) ignores BORG_STORE_CACHE. with_repository and get_repository pass it through; check and repo-compress use it.
Contributor
Author
|
Rebased on current master, the only conflict was the |
mr-raj12
force-pushed
the
store-cache-check-10397
branch
from
October 6, 2026 18:25
32213b9 to
c28db79
Compare
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
borg checkandborg repo-compressread the packs from the repository, also ifBORG_STORE_CACHEis set. This implements idea 1 of #10397, fixes #10397.The cached packs are not verified against the repository. With the cache:
borg check --verify-datareported an integrity error for a damaged cache file, andborg check --repair --verify-datadeleted the intact object from the repository.borg check --archives-only --verify-datadid not find damage in the repository while an intact copy of the pack was cached.borg repo-compresscopies objects that already use the target compression into the new pack without authenticating them, then deletes the old pack. A damaged cache file ended up in the repository.Changes:
Repository(store_cache=True):store_cache=FalseignoresBORG_STORE_CACHE, all packs are read from the repository.with_repositoryandget_repositorypassstore_cachethrough.checkandrepo-compressusestore_cache=False.borg check,borg repo-compressandBORG_STORE_CACHEupdated.Tests:
test_store_cache_argument:store_cacheTrue/False, local andssh://.test_store_cache_default_directory:BORG_STORE_CACHE=1caches the packs in<cache_dir>/storecache.test_check_verify_data_ignores_a_corrupt_store_cache: damaged cached packs,check --verify-dataandcheck --repair --verify-datareport no error, no pack is removed.test_check_archives_only_verify_data_ignores_an_intact_store_cache: damaged repository pack, intact cached copy,check --archives-only --verify-datareports the integrity error.test_repo_compress_ignores_a_corrupt_store_cache: damaged cached packs,repo-compress -C nonerewrites packs,check --verify-datais clean afterwards.The three check / repo-compress tests fail if
checkandrepo-compressuse the cache.Not in this PR: other readers (extract, mount, ...) still fail on a damaged cache file until the cache directory is deleted (ideas 2 to 4 of #10397).
Checklist
master(or maintenance branch if only applicable there)toxor the relevant test subset)