Repository navigation
perf(storage): skip inline payload decoding in cleaner scans - #238
Merged
Merged
Conversation
efirs
approved these changes
Aug 22, 2026
Greptile SummaryCleaner scans now extract expiry and value length directly from protobuf wire data, avoiding reconstruction and copying of inline payloads while retaining full-record validation.
Confidence Score: 5/5The PR appears safe to merge, with no concrete changed-code failure identified. The wire-level scanners preserve protobuf scalar and validation semantics on reachable cleaner paths, while expired rows still decode the control metadata needed for size accounting and backing-storage reclamation. Important Files Changed
Reviews (1): Last reviewed commit: "perf(storage): skip inline payload decod..." | Re-trigger Greptile |
|
🎉 This PR is included in version 1.12.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
The change
Cleaner reconciliation now reads
value_lengthfrom theValueMessagewire data, and TTL cleanup reads expiry first. Inline payloads and control messages are no longer reconstructed for ordinary non-expiring rows.The scanner validates the complete record, including path UTF-8 and duplicate scalar fields. Expired rows still decode their control fields because file and segment reclamation needs them.
Testing
make test-storage-wiremake test-storage-reconcileWorkload:
uncapped hourly cleanup-loop reconciliation with the default 64 MiB compaction threshold, 24 inline 64 KiB and 8 segment-converted 64 KiB+1 valuesB/opallocs/opWorkload:
capped LRU-backfill cleanup-loop reconciliation with 32 inline 64 KiB valuesB/opallocs/opGenerated by Perfloop. Measurements and checks.
Note
Medium Risk
Touches cleaner TTL and metadata-scan validation, which drive size accounting and eviction. Behavior is intended to match full protobuf decode, but a wire-parser mismatch could skip or delete the wrong rows.
Overview
TTL cleanup no longer fully unmarshals every metadata row. It reads
expiryoff the wire and only reconstructs control fields (still skipping inlineData) for expired keys that need file/segment reclaim.Wire extractors now reject invalid protobuf field numbers and non-UTF-8 path strings, matching
proto.Unmarshal, so malformed rows stay skipped for size accounting and deleted on TTL scan.Adds a scheduled
cleanupLoopreconciliation benchmark/test (capped LRU backfill and uncapped hourly recalc) plus Makefile targetsbuild-storage-bench,test-storage-wire, andtest-storage-reconcile.lastSizeRecalcandonTickCompleteexist so tests can drive a single tick without changing cleaner work.Reviewed by Cursor Bugbot for commit e54cd8f. Bugbot is set up for automated code reviews on this repo. Configure here.