Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item: remove .chunks_healthy, fixes #8559 #8568

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ThomasWaldmann
Copy link
Member

@ThomasWaldmann ThomasWaldmann commented Nov 25, 2024

Well, it's not totally removed, some code in Item, archive and borg transfer --from-borg1 needs to stay in place, so that we can pick the CORRECT chunks list that is in .chunks_healthy for all-zero-replacement-chunk-patched items when transferring archives from borg1 to borg2 repos.

FUSE fs read: IOError or all-zero result (depending on allow_damaged_files option)

extract, diff, ...: fetch_many() will on-the-fly create all-zero replacement chunks (of correct size, if size is known) if it gets a None result (not: bytes chunk cdata) from repo.get() because a chunk is missing. it will also emit an ERROR about the missing chunk, with chunk id and size.

Also fixes: #8562

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 80.95238% with 16 lines in your changes missing coverage. Please review.

Project coverage is 81.91%. Comparing base (1559a1e) to head (a89001d).
Report is 22 commits behind head on master.

Files with missing lines Patch % Lines
src/borg/archiver/transfer_cmd.py 59.09% 7 Missing and 2 partials ⚠️
src/borg/archive.py 88.46% 1 Missing and 2 partials ⚠️
src/borg/legacyrepository.py 66.66% 1 Missing and 1 partial ⚠️
src/borg/archiver/compact_cmd.py 83.33% 1 Missing ⚠️
src/borg/remote.py 91.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8568      +/-   ##
==========================================
+ Coverage   81.83%   81.91%   +0.07%     
==========================================
  Files          74       74              
  Lines       13319    13318       -1     
  Branches     1963     1964       +1     
==========================================
+ Hits        10900    10909       +9     
+ Misses       1755     1749       -6     
+ Partials      664      660       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ThomasWaldmann ThomasWaldmann force-pushed the remove-chunks-healthy branch 2 times, most recently from b0b3455 to d99598c Compare December 28, 2024 17:46
@ThomasWaldmann ThomasWaldmann force-pushed the remove-chunks-healthy branch 2 times, most recently from 2a7df01 to 69d504d Compare January 8, 2025 17:51
Well, it's not totally removed, some code in Item, Archive and
borg transfer --from-borg1 needs to stay in place, so that we
can pick the CORRECT chunks list that is in .chunks_healthy
for all-zero-replacement-chunk-patched items when transferring
archives from borg1 to borg2 repos.

transfer: do not transfer replacement chunks, deal with missing chunks in other_repo

FUSE fs read: IOError or all-zero result
it now takes either:
- a list of ChunkListEntry namedtuples
- a list of chunk IDs [bytes]
@ThomasWaldmann ThomasWaldmann force-pushed the remove-chunks-healthy branch from 69d504d to 8c4890e Compare March 1, 2025 18:51
preloading: always use raise_missing=False, because
the behaviour is defined at preloading time.

fetch_many: use get_many with raise_missing=False.
if get_many yields None instead of the expected chunk
cdata bytes, on-the-fly create an all-zero replacement
chunk of the correct size (if the size is known) and
emit an error msg about the missing chunk id / size.

note: for borg recreate with re-chunking this is a bit
unpretty, because it will transform a missing chunk into
a zero bytes range in the target file in the recreated
archive. it will emit an error message at recreate time,
but afterwards the recreated archive will not "know"
about the problem any more and will just have that
zero-patched file.
so guess borg recreate with re-chunking should better
only be used on repos that do not miss chunks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

borg2: cosmetic bug in compact
1 participant