Repository navigation
Pin that the SSD store and the disk index hold the same keys after every operation - #457
Merged
matrixarkai merged 1 commit intoNov 14, 2026
Conversation
…ery operation Invalidation sends a delete to the SSD store for every key it names, including keys the index does not hold, and that costs about 8.7K instructions per call in a shared-store profile. Skipping the delete for keys absent from the index is only correct if no block can sit in the store without an index entry. Nothing asserted that. The test runs two thousand deterministic pseudo-random puts, rewrites, batch puts, single and batch invalidations over two hundred keys, in a tier that holds about forty blocks so evictions are constant, and after every operation compares the keys whose blocks are in the store with the keys the index holds, both ways. It passes on main: the two do not drift. It is a test only; no behaviour changes. It does not cover a restart. Whether a block can survive in the store across one with no index entry is the other half of the question and needs a recovery test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Invalidation sends a delete to the SSD store for every key it names, including keys the disk index does not hold, and in a TemporalStore shared-store profile that call is about 8.7K instructions per invalidation (4.7% of the run). Skipping it for keys absent from the index would be a real saving, but it is only correct if no block can sit in the store without an index entry. Nothing asserted that. This pins it; it is a test only and changes no behaviour.
The test runs 2,000 deterministic pseudo-random puts, rewrites, batch puts, single invalidations and batch invalidations over 200 keys, in a tier that holds about 40 blocks so evictions are constant, and after every operation compares the keys whose blocks are in the store (
ssd_block_exists) with the keys the index holds, in both directions. It passes on main: the two never drift.It can fail. With invalidation's
delete_ssd_blockscall removed, it fails at step 9 with "a block is in the SSD store with no index entry"; restored, it passes (about 5 s).What it does not cover: a restart. Recovery rebuilds the index from the store, so whether a block can survive a crash with no index entry is the other half of the question, and it needs a recovery test. So this alone does not make skipping the delete safe; it shows the necessary condition holds within a running cache.
Checks:
cargo fmt --all --checkis clean; the new test passes.🤖 Generated with Claude Code