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

enable partial/incremental ChunkIndex cache updates #8541

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

Conversation

ThomasWaldmann
Copy link
Member

@ThomasWaldmann ThomasWaldmann commented Nov 14, 2024

Fixes #8503.
Fixes #8538.

- ChunkIndex: implement system flags
- ChunkIndex: F_NEW flag as 1st system flag for newly added chunks
- incrementally write only NEW chunks to repo/cache/chunks.*
- merge all chunks.* when loading the ChunkIndex from the repo

Also: the cached ChunkIndex only has the chunk IDs. All values are just dummies.
The ChunkIndexEntry value can be used to set flags and track size, but we
intentionally do not persist flags and size to the cache.

The size information gets set when borg loads the files cache and "compresses"
the chunks lists in the files cache entries. After that, all chunks referenced
by the files cache will have a valid size as long as the ChunkIndex is in memory.
This is needed so that "uncompress" can work.
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 2 lines in your changes missing coverage. Please review.

Project coverage is 81.79%. Comparing base (56493fc) to head (295f4e3).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/borg/cache.py 92.85% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8541      +/-   ##
==========================================
- Coverage   81.80%   81.79%   -0.02%     
==========================================
  Files          74       74              
  Lines       13281    13290       +9     
  Branches     1955     1956       +1     
==========================================
+ Hits        10864    10870       +6     
- Misses       1754     1756       +2     
- Partials      663      664       +1     

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

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: fix the files cache entry compression cache coherency issues leading to a slowdown
1 participant