Skip to content

cache: avoid duplicate multilevel reads - #2835

Open
zfaustk wants to merge 1 commit into
mozilla:mainfrom
zfaustk:zfaustk/t022-author-fix
Open

cache: avoid duplicate multilevel reads#2835
zfaustk wants to merge 1 commit into
mozilla:mainfrom
zfaustk:zfaustk/t022-author-fix

Conversation

@zfaustk

@zfaustk zfaustk commented Aug 30, 2026

Copy link
Copy Markdown

Fixes #2817

When a lower cache level had a hit, MultiLevelStorage fetched the object once to parse it and again to backfill faster levels. This change lets raw-capable backends return the parsed cache entry and its bytes together, so the same object is read only once. Backends without the override keep the existing behavior.

The focused multilevel regression passes, along with cargo fmt -- --check and the required locked clippy command. The full locked library/binary/test suite is left to CI because an unchanged macOS integration helper aborts while loading a libc function pointer on this host.

@codecov-commenter

codecov-commenter commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.24%. Comparing base (c710468) to head (75f3d9e).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/cache/cache.rs 36.84% 12 Missing ⚠️
src/cache/readonly.rs 0.00% 3 Missing ⚠️
src/cache/multilevel_test.rs 96.61% 2 Missing ⚠️
src/cache/multilevel.rs 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2835      +/-   ##
==========================================
- Coverage   73.82%   72.24%   -1.58%     
==========================================
  Files          72       72              
  Lines       38087    39257    +1170     
==========================================
+ Hits        28117    28362     +245     
- Misses       9970    10895     +925     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Multi-level: a hit on a lower level fetches the same object twice

2 participants