Repository navigation
Come down to the bound when recovery finds more than fits - #190
Merged
Merged
Conversation
Re-opening a cache with a smaller capacity than the one that wrote the data is an ordinary event: the device shrank, or the configuration did. Recovery indexes what is on the device -- and stopped there. Measured: 256 incompressible kibibyte blocks written with a mebibyte of SSD room, re-opened with 64 kibibytes and recovered. All 256 came back, 268,800 bytes resident against a 65,536-byte capacity -- four times the bound, counted in the tier's own figures, with nothing on the way to removing it. The next write would have begun evicting. A cache nobody writes to again would have stayed there. Recovery now ends by bringing both persistent tiers down to their capacities, which is where the bound belongs: after the operation that filled them, not at the next write. The same measurement afterwards keeps 62 of the 256 blocks and 65,100 bytes. The test checks the surviving index as well as the figure. An eviction that drops a block but keeps its index entry would leave a key the cache claims to hold and cannot serve, which is the failure this change would most likely cause, so every surviving key is read back. The fixture writes incompressible bytes, and says why: with a compressible value the blocks shrink to forty-four bytes each, the smaller capacity is never reached, and the test measures nothing. That trap has already cost this work two measurements. Planted the missing eviction: "recovery left the tier holding 268800 bytes against a capacity of 65536". Co-Authored-By: Claude Opus 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.
Re-opening a cache with a smaller capacity than the one that wrote the data is
an ordinary event: the device shrank, or the configuration did. Recovery
indexes what is on the device — and stopped there.
Four times the bound, counted in the tier's own figures, with nothing on the
way to removing it. The next write would have begun evicting; a cache nobody
writes to again would have stayed there.
Recovery now ends by bringing both persistent tiers down to their capacities —
which is where a bound belongs, after the operation that filled them rather
than at the next write. This is the same guarantee as the pin release in the
previous change, on the other path that can leave a tier above its capacity.
The test checks the index, not only the figure
An eviction that drops a block but keeps its index entry leaves a key the cache
claims to hold and cannot serve. That is the failure this change would most
likely cause, so the test reads back every surviving key rather than
trusting the byte count.
The fixture writes incompressible bytes and says why: with a compressible value
the blocks shrink to forty-four bytes each, the smaller capacity is never
reached, and the test measures nothing. That trap has already cost this work
two measurements.
Planted
Gates on both feature arms:
cargo fmt --check,clippy --all-targets -D warnings, the suites, the vocabulary check, and both reports with--require-passed.🤖 Generated with Claude Code