Repository navigation
perf(storage): skip unused inline payload decoding - #240
Merged
Merged
Conversation
Signed-off-by: Perfloop Agent <[email protected]>
Signed-off-by: Perfloop Agent <[email protected]>
Greptile SummaryThe PR optimizes delete and overwrite cleanup by scanning only the protobuf fields needed for accounting and backing-storage reclamation, avoiding inline payload decoding.
Confidence Score: 5/5The PR appears safe to merge, with cleanup ordering and decoding behavior preserved by the optimized path. The reduced decoder retains every field used by deletion and overwrite cleanup, validates the complete wire record, copies paths before releasing RocksDB storage, and leaves segment crediting and raw-file deletion at their required transactional boundaries. Important Files Changed
Reviews (1): Last reviewed commit: "perf(storage): skip unused inline payloa..." | Re-trigger Greptile |
ovaistariq
approved these changes
Aug 23, 2026
|
🎉 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.
What changed
Replace the temporary
ValueMessageused byDeleteKeyand overwrite cleanup with a bounded wire scan. These paths retain only the value type, length, and backing paths, so they skip inline payload data they do not use.The scan is intentionally limited to cleanup fields. It validates the full record and copies retained paths before the RocksDB slice is released; callers that need payload bytes retain the full protobuf decode.
Add public delete benchmarks for inline, raw-file, and segment-backed values, plus overwrite guardrails for the shared cleanup path.
Testing
STATIC_BUILD=true make test-storage TESTRUN=DecodeValueMessageCleanupFieldsSTATIC_BUILD=true make test-storage TEST=TestStorage_DeleteKey_MalformedSegmentMetadataSkipsCleanupSTATIC_BUILD=true make test-storage TESTRUN=TestStorage_DeleteIndexSTATIC_BUILD=true make test-storage TESTRUN=TestPutOverwriteSTATIC_BUILD=true make test-server TEST=TestCacheServiceDeleteInlineAtDefaultThresholdSTATIC_BUILD=true make test-server TEST=TestCacheServiceDeleteSegmentSTATIC_BUILD=true make test-server TEST=TestCacheServicePutObjectOverwriteSegmentSTATIC_BUILD=true make lintSTATIC_BUILD=true make license-checkWorkload:
CacheService.Delete of a present 64 KiB INLINE valueB/opallocs/opGenerated by Perfloop. Measurements and checks.
Note
Medium Risk
Touches delete and overwrite reclaim (size accounting, raw-file queueing, segment dead-byte credits). Decode mismatches could skip cleanup or mis-credit segments; tests cover malformed metadata and proto agreement.
Overview
Delete and overwrite cleanup no longer materialize a full
ValueMessage(including up to 64 KiB of inlineData).DeleteKeyandexistingValuenow scan only type, length, and backing paths viadecodeValueMessageCleanupFields, then copy those paths so they remain valid after the RocksDB slice is released.Malformed records still drop metadata without crediting a segment they cannot decode. Adds CacheService delete/overwrite benchmarks (inline, raw file, segment) and a Makefile compile target for paired runs.
Reviewed by Cursor Bugbot for commit 7afc15e. Bugbot is set up for automated code reviews on this repo. Configure here.