Skip to content

compact: suggest a full check --repair for unindexed pack bytes, fixes #10429 - #10443

Open
mr-raj12 wants to merge 1 commit into
borgbackup:masterfrom
mr-raj12:compact-unindexed-hint
Open

mr-raj12 wants to merge 1 commit into
borgbackup:masterfrom
mr-raj12:compact-unindexed-hint

Conversation

@mr-raj12

@mr-raj12 mr-raj12 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Merge before #10445, which is rebased on this branch.

The info message borg compact logs for pack bytes no index entry covers pointed to #8572, which is closed. These bytes can be reclaimed today: a full borg check --repair rebuilds the chunk index from all packs, and the next borg compact reclaims the unused objects.

  • compact: the message now says to run borg check --repair (without --repository-only), then borg compact. --repository-only rebuilds the index only if it is corrupt, so it does not index these objects. The borg compact --help text says the same.
  • The remaining to pack or not to pack ... #8572 references (check --help text, repository check error message, comments) now point to borg2 check: implement repository repair (index and pack rebuild) #10026, which tracks repository repair and corrupt-pack salvage.
  • test: test_compact_reclaims_indexed_waste_only asserts the new message.

Reproduced with a 2.5 GB borg create killed with kill -9:

step repo size message
borg compact -v 535M shown
borg check --repair --repository-only, borg compact 535M shown
borg check --repair, borg compact 20K not shown
borg check rc=0

Objects that fail authentication during the index rebuild stay unindexed, so compact keeps reporting their bytes after a repair.

fixes #10429

Checklist

  • PR is against master (or maintenance branch if only applicable there)
  • New code has tests and docs where appropriate
  • Tests pass (run tox or the relevant test subset)
  • Commit messages are clean and reference related issues

@codecov

codecov Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.73%. Comparing base (8274470) to head (8910d40).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #10443   +/-   ##
=======================================
  Coverage   88.73%   88.73%           
=======================================
  Files         103      103           
  Lines       19387    19387           
  Branches     3023     3023           
=======================================
  Hits        17204    17204           
  Misses       1514     1514           
  Partials      669      669           

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

This branch has not been deployed

No deployments
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.

compact: orphaned-pack message points to closed #8572 instead of suggesting check --repair

1 participant