Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10477 +/- ##
=======================================
Coverage 88.73% 88.74%
=======================================
Files 103 103
Lines 19392 19394 +2
Branches 3024 3024
=======================================
+ Hits 17208 17211 +3
+ Misses 1515 1514 -1
Partials 669 669 ☔ View full report in Codecov by Harness. |
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
Implements option A of #10396:
repo-createandrepo-deleteonly act on the repository, not on theBORG_STORE_CACHEdirectory. refs #10396.With
BORG_STORE_CACHEset (master a586f69, borgstore 0.7.0):borg repo-createfailed with rc 11 ("has no repository config") as soon as the cache directory was not empty, and left an empty repository directory behind.borg repo-deleteremoved the whole cache directory: the cached packs of all other repositories and any other file in there.Changes:
Repository(create=True)does not give a cache to theStore.Repository.destroy()and the cleanup after a failed create destroy the store's backend only (Repository._destroy_store).BORG_STORE_CACHE: cached packs of a deleted repository stay until they are evicted or the directory is removed.Tests:
test_create_with_a_filled_store_cache(file, ssh): creating a repository leaves a filled cache directory unchanged, the cache is used when the repository is opened afterwards.test_destroy_keeps_the_store_cache(file, ssh):destroy()removes the repository, the cache directory keeps all its files.test_create_failure_keeps_the_store_cache: a failingsave_config/openafter the store was created removes the store, the cache directory keeps all its files.test_repo_create_with_a_filled_store_cache: a secondborg repo-createworks.test_delete_repo_keeps_the_store_cache:borg repo-deleteof one repository keeps the cache files, the other repository still extracts.test_gather_many_one_gather_for_many_packsandtest_salvage_pack_refuses_with_a_pack_store_cachenow reopen the repository after creating it, so they still run with the cache.The create and destroy tests fail on master.
test_destroy_keeps_the_store_cacheandtest_delete_repo_keeps_the_store_cachealso fail if only_destroy_storecallsStore.destroy().Not in this PR: a per-repository cache directory (option B) and a check for a cache directory that holds other content. Touches the same lines of
Repository.__init__as #10467.Checklist
master(or maintenance branch if only applicable there)toxor the relevant test subset)