Skip to content

Comments

cache: remove try_upgrade_to_b14() legacy migration, fixes #9371#9372

Merged
ThomasWaldmann merged 1 commit intoborgbackup:masterfrom
mr-raj12:remove-try-upgrade-to-b14
Feb 19, 2026
Merged

cache: remove try_upgrade_to_b14() legacy migration, fixes #9371#9372
ThomasWaldmann merged 1 commit intoborgbackup:masterfrom
mr-raj12:remove-try-upgrade-to-b14

Conversation

@mr-raj12
Copy link
Contributor

Summary

  • Remove try_upgrade_to_b14() from src/borg/cache.py — a one-time migration function marked # TODO: remove this before 2.0.0 release
  • Added in b14 (d4310dd, Nov 2024) to invalidate old chunk index caches after the refcountflags rename and CHUNKINDEX_HASH_SEED change
  • Any repo used since b14 has already been cleaned up — the function is now a no-op that always hits the except branch
  • It runs on every build_chunkindex_from_repo() call, issuing 2 unnecessary store_delete() RPCs per cache rebuild
  • Old caches are also rejected at the hash-validation level in read_chunkindex_from_repo_cache(), so this function provides no safety net

Fixes #9371

Changes

File Change
src/borg/cache.py Removed try_upgrade_to_b14() (lines 697–705) and its call in build_chunkindex_from_repo() (line 810)

Checklist

  • PR is against master
  • Single-topic changeset — removal only, no mixed refactoring
  • Code formatted with black

@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.44%. Comparing base (c7261ae) to head (cace06f).
⚠️ Report is 3 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9372   +/-   ##
=======================================
  Coverage   76.44%   76.44%           
=======================================
  Files          85       85           
  Lines       14806    14799    -7     
  Branches     2213     2212    -1     
=======================================
- Hits        11318    11313    -5     
+ Misses       2810     2808    -2     
  Partials      678      678           

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

@ThomasWaldmann ThomasWaldmann merged commit 9533b50 into borgbackup:master Feb 19, 2026
19 checks passed
@ThomasWaldmann
Copy link
Member

Thanks!

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.

cache: remove try_upgrade_to_b14() legacy migration before 2.0.0 release

2 participants