Repository navigation
Pin that the SSD store and the disk index still agree across recoveries - #458
Merged
matrixarkai merged 1 commit intoNov 14, 2026
Merged
Conversation
The invariant test covers a running cache. Skipping the SSD store delete for a key the index does not hold is only correct if recovery cannot change that: recovery rebuilds the index from the store, so a block that sat in the store with no index entry would come back as an indexed, servable key. The new test runs 1,500 deterministic puts, single and batch invalidations over 200 keys in a tier of about forty blocks, with durable SSD blocks, and recovers the persistent tiers every 97 steps. Before and after each recovery it compares the keys whose blocks are in the store with the keys the index holds, both ways, and it checks that a key invalidated since its last write has not come back. It passes on main. Test only; no behaviour changes. It still does not cover a process that dies between the store write and the index update, which is an error path, not a normal one. 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.
Follow-up to #457. That test pins that the SSD store and the disk index hold the same keys after every operation in a running cache. Skipping the SSD store delete for a key the index does not hold (about 8.7K instructions per invalidation, 4.7% of a shared-store harness run) is only correct if recovery cannot change that either: recovery rebuilds the index from the store, so a block that sat in the store with no index entry would come back as an indexed, servable key.
The new test runs 1,500 deterministic puts and single and batch invalidations over 200 keys, in a tier of about forty blocks with durable SSD blocks, and recovers the persistent tiers every 97 steps. Before and after each recovery it compares the keys whose blocks are in the store with the keys the index holds, in both directions, and it checks that a key invalidated since its last write has not come back. It passes on main. It is a test only and changes no behaviour.
It can fail. With invalidation's
delete_ssd_blockscall removed, it fails at step 27 with "a block is in the SSD store with no index entry"; restored, it passes (about 3 s).What it still does not cover: a process that dies between the store write and the index update. That is an error path (a failed write, or a crash mid-batch), not a normal one, and covering it needs fault injection. So together with #457 this shows the necessary condition for the skip holds in normal operation and across recovery; it does not by itself show the skip is safe, and that remains a durability decision for the owners of this crate.
Checks:
cargo fmt --all --checkis clean; both invariant tests pass.🤖 Generated with Claude Code