Conversation
…orgbackup#9901 Repair reads the key and aborts if it can not; objects that fail validation are not indexed and are reported as errors.
Every check --repair rebuild of the chunk index has an object validator (borgbackup#10369), so drop_corrupt_tail was only reachable from tests. - PackReader.iter_headers: remove the drop_corrupt_tail parameter. Without a validator, a corrupt object header raises IntegrityError. - build_chunkindex_from_repo: remove the drop_corrupt_tail parameter. - Repository: remove chunkindex_drop_corrupt_tail. - ArchiveChecker.check: stop passing and setting drop_corrupt_tail. - tests: remove the 5 tests for drop_corrupt_tail, rewrite test_check_without_repair_does_not_drop_a_pack_tail as test_check_without_key_aborts_on_a_corrupt_pack_header.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10378 +/- ##
==========================================
- Coverage 88.12% 88.11% -0.02%
==========================================
Files 103 103
Lines 18928 18843 -85
Branches 2923 2911 -12
==========================================
- Hits 16681 16604 -77
+ Misses 1556 1554 -2
+ Partials 691 685 -6 ☔ View full report in Codecov by Harness. |
33 tasks
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
Follow-up to #10369, review point 3. Every
check --repairrebuild of the chunk index now has an object validator, sodrop_corrupt_tailwas only reachable from tests.Depends on #10369. This branch contains its commit; I will rebase onto master after #10369 is merged.
Changes
PackReader.iter_headers(): remove thedrop_corrupt_tailparameter. Without a validator, a corrupt object header raisesIntegrityError.build_chunkindex_from_repo(): remove thedrop_corrupt_tailparameter.Repository: removechunkindex_drop_corrupt_tail.ArchiveChecker.check(): stop passingdrop_corrupt_tail=repairand settingrepository.chunkindex_drop_corrupt_tail.No behaviour change: a walk without a validator only happens in a check without
--repair, and it already raised.Tests
repository_test.py::test_pack_reader_drops_a_corrupt_tail_only_when_askedrepository_test.py::test_pack_reader_drops_a_corrupt_tail_without_an_on_droprepository_test.py::test_pack_reader_drop_corrupt_tail_does_not_affect_a_validating_walkcache_test.py::test_build_chunkindex_without_a_validator_drops_the_rest_of_a_damaged_packcache_test.py::test_build_chunkindex_without_drop_corrupt_tail_raises_on_a_damaged_packcheck_cmd_test.py::test_check_without_repair_does_not_drop_a_pack_tailrenamed totest_check_without_key_aborts_on_a_corrupt_pack_header. It asserts that the rebuild gets no validator and raisesCorruptPack.test_pack_reader_raises_on_bad_magic(raises without a validator) andtest_build_chunkindex_repair_resyncs_after_corrupt_header(CorruptPackwithout a validator; with one, the rebuild skips the damaged object and indexes the next one).TZ=UTC pytest --benchmark-skip -n auto: 3072 passed, 1141 skipped.Note for #10368
#10368 still passes
drop_corrupt_tail=repairand setschunkindex_drop_corrupt_tailinArchiveChecker.check(). Whichever PR merges second removes those two lines.Checklist
master(or maintenance branch if only applicable there)toxor the relevant test subset)