Skip to content

cache sync: log per-archive messages at debug level, fixes #9659 - #10217

Merged
ThomasWaldmann merged 1 commit into
borgbackup:1.4-maintfrom
ThomasWaldmann:cache-sync-log-level-9659
Aug 27, 2026
Merged

cache sync: log per-archive messages at debug level, fixes #9659#10217
ThomasWaldmann merged 1 commit into
borgbackup:1.4-maintfrom
ThomasWaldmann:cache-sync-log-level-9659

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

Fixes #9659.

The chunks cache sync emitted 2 INFO lines per archive, so -v / --info floods on repos with many archives:

  • warm chunks.archive.d (the usual case): Reading cached archive chunk index for <name> ... + Merging into master chunks index ...
  • cache rebuild: Fetching and building archive index for <name> ... + Merging into master chunks index ...

The issue listed three lines (872/875/879), but missed cache.py:804 (Reading cached archive chunk index), which is the partner of the Merging line in the common warm-cache path — without it, only half the noise would go away. This PR demotes all four.

--info output is now just the summary the reporter asked for:

Synchronizing chunks cache...
Archives: %d, w/ cached Idx: %d, w/ outdated Idx: %d, w/o cached Idx: %d.
Done.

Notes:

  • Per-archive feedback for interactive use is unaffected: --progress still drives the cache.sync ProgressIndicatorPercent, which names each archive as it is processed.
  • borg 2 (master) already logs this whole area at debug level — there is no per-archive INFO logging left in its cache.py — so this aligns the branches.
  • ArchiverCorruptionTestCase::test_chunks_archive greps for two of these messages, so its create -v becomes create --debug. (Its third assert is a logger.error and is unaffected.)
  • No CHANGES entry, matching the recent 1.4-maint PRs.

…#9659

The chunks cache sync emitted 2 INFO lines per archive:

- warm chunks.archive.d (the usual case):
  "Reading cached archive chunk index for <name> ..." plus
  "Merging into master chunks index ..."
- cache rebuild:
  "Fetching and building archive index for <name> ..." plus
  "Merging into master chunks index ..."

On repositories with many archives this floods the output of anybody
running with -v / --info, without telling them much - "Merging into
master chunks index ..." does not even name the archive.

Log these at debug level, so --info now only shows the summary:

    Synchronizing chunks cache...
    Archives: %d, w/ cached Idx: %d, w/ outdated Idx: %d, w/o cached Idx: %d.
    Done.

Per-archive feedback for interactive use is still available via
--progress (the cache.sync progress indicator names each archive), and
borg 2 already logs all of this at debug level.
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.10%. Comparing base (92c7f07) to head (bd8f53e).
⚠️ Report is 1 commits behind head on 1.4-maint.

Files with missing lines Patch % Lines
src/borg/cache.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           1.4-maint   #10217      +/-   ##
=============================================
- Coverage      82.14%   82.10%   -0.04%     
=============================================
  Files             38       38              
  Lines          11475    11475              
  Branches        1807     1807              
=============================================
- Hits            9426     9422       -4     
- Misses          1464     1466       +2     
- Partials         585      587       +2     

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

@ThomasWaldmann
ThomasWaldmann merged commit 6bd22a4 into borgbackup:1.4-maint Aug 27, 2026
11 of 14 checks passed
@ThomasWaldmann
ThomasWaldmann deleted the cache-sync-log-level-9659 branch August 27, 2026 17:47
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