Skip to content

recreate: keep chunker_params if not rechunkifying, fixes #10127 - #10130

Merged
ThomasWaldmann merged 1 commit into
borgbackup:1.4-maintfrom
ThomasWaldmann:recreate-chunker-params-10127
Aug 16, 2026
Merged

ThomasWaldmann merged 1 commit into
borgbackup:1.4-maintfrom
ThomasWaldmann:recreate-chunker-params-10127

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

If no --chunker-params was given, borg recreate does not rechunk, so the target archive keeps the source archive's chunks. But it still recorded the default chunker params in the target archive's metadata: after e.g.

borg recreate --comment "This is a comment" repo::archive

an archive created with --chunker-params=buzhash,10,23,16,4095 claimed buzhash,19,23,21,4095 in borg info --json, although its chunks were still the original ones.

Now ArchiveRecreater.create_target computes the target chunker params first: if we rechunkify, the new params are used (and recorded, as before); otherwise the target inherits the source archive's chunker params, so the metadata keeps describing how the chunks were actually made. If the source archive has no chunker params in its metadata (very old archives), we fall back to the defaults as before.

Added a regression test that checks the recorded chunker params after recreating with and without --chunker-params.

…10127

If no --chunker-params was given, borg recreate does not rechunk, so the
target archive keeps the source archive's chunks. But it still recorded
the default chunker params in the target archive's metadata, so e.g.
"borg recreate --comment ..." of an archive created with non-default
chunker params claimed the default params afterwards.

Now the target archive inherits the source archive's chunker params
(if they are known) unless we actually rechunkify.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.13%. Comparing base (b0b133c) to head (4b74b44).
⚠️ Report is 1 commits behind head on 1.4-maint.

Additional details and impacted files
@@              Coverage Diff              @@
##           1.4-maint   #10130      +/-   ##
=============================================
+ Coverage      82.10%   82.13%   +0.02%     
=============================================
  Files             38       38              
  Lines          11435    11435              
  Branches        1802     1802              
=============================================
+ Hits            9389     9392       +3     
+ Misses          1461     1459       -2     
+ Partials         585      584       -1     

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

@ThomasWaldmann
ThomasWaldmann merged commit 5f14805 into borgbackup:1.4-maint Aug 16, 2026
18 of 22 checks passed
@ThomasWaldmann
ThomasWaldmann deleted the recreate-chunker-params-10127 branch August 16, 2026 19:46
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.

1 participant