Repository navigation
perf(retention): stop metadata scans at complete manifests - #4714
Closed
ScriptedAlchemy wants to merge 2 commits into
Closed
ScriptedAlchemy wants to merge 2 commits into
ScriptedAlchemy wants to merge 2 commits into
Conversation
|
Contributor
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
This was referenced Nov 3, 2026
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The storage-report/retention metadata scanner eagerly reserved the entire 16 MiB prefix and allocated a 1 MiB read buffer. Even
MetadataOnlycontinued reading until EOF or the prefix ceiling, although a complete manifest and format revision could be available near the beginning. This is avoidable allocation and payload I/O in the read-only report path.Change
Fullcontinues hashing from the exact position of the same open file and still includes every byte;MetadataOnlyremains non-authoritative for deletion.Read::take/read_to_end.No retention eligibility, locks, reader protection, destructive execution, file format, reporting schema, or request budget changes.
Regression coverage
Seven added tests exercise actual temporary generation files and the production scanner: early metadata stopping with an observed file position, complete hashing and tail mutation detection, multi-chunk manifests, the unchanged prefix ceiling, malformed manifest refusals in both modes, cancellation before/after I/O, and complete integer decoding. The end-to-end scanner result retains the original file size and expected digest semantics.
Validation and limits
Reviewed the report call path, metadata-only versus full-verification distinction, shared fixture shape, and complete GitHub-generated production diff. Staged-source whitespace/final-newline checks passed, and its Git blob hash exactly matches the published source (
706bb2e3035f29612fe612970d30bdbe4a6f4d11).Rust compilation, rustfmt, Clippy and the seven regressions have not run locally: this environment has no supplied checkout or Rust/Bazel toolchain. No Cargo commands were run. Hosted CI must compile and execute the affected code-index-retention and maintenance/report suites before merge.
Refs #4616, specifically the storage-report resource-use portion of acceptance item 5. This does not establish the cause of the reported OOM or prove completion on the reported 70-generation/15-GB store. Sealed-generation GC, unsafe-artifact isolation, retention fairness and reclaim guidance remain open. No production RSS or elapsed-time improvement is claimed.