Conversation
KVShard.PutDyna, PutPerm and Put each ran KV2.Compress, and so CompactHistory, on the calling goroutine once a shard's write count passed 5,000. Nothing scheduled it; it dates from the sharding commit. On the block-committing goroutine that was 3.4 s of every 30 s at nineteen minutes of load, growing with history, and twice in twenty goroutine snapshots the block loop was caught inside CompactHistory from PutDyna: once fsyncing the merged segment, once waiting on the maintenance lock the adapter's own pass held. Spec 1.2 and 1.6: the protocol path never waits for maintenance. The puts no longer compact. Compress stays for the caller's cadence, which the adapter already runs off the protocol path. PutPerm now reports the perm write count instead of the dyna one. TestPutNeverCompacts drives a shard past the old trigger with history to fold, fails if CompactHistory runs from inside a put, and then asserts that an explicit Compress does fold that history, so the check is not vacuous. It fails without the fix and passes with it. Closes #92. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015wUZmWRdAPtcfFgYrLJCc5
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.
Closes #92.
KVShard.PutDyna,PutPermandPutranKV2.Compress→CompactHistorysynchronously on the calling goroutine once a shard's write count passed 5,000. Nothing scheduled it; it dates from the sharding commit. On the block-committing goroutine that was 3.4 s of every 30 s at nineteen minutes of soak load (profile in #92), growing with history, and in 2 of 20 goroutine snapshots the block loop was insideCompactHistoryfromPutDyna: once fsyncing the merged segment itself, once waiting on the maintenance lock held by the adapter's own async pass.Invariant: 1.2 (no protocol-path cost growing with the age of the store) and 1.6 (the protocol path never waits for maintenance). Not in the 2.10 register; this PR closes the gap rather than adding a row. SPEC 2.7 now says nothing on the protocol path starts a pass.
Change
kv_shard.go: the three puts no longer compact.Compressstays for the caller's cadence (the accumulate adapter'smaintain()already runs it off the protocol path).kv_2.go:PutPermreports the perm write count (it returned the dyna one).TestPutNeverCompacts: one shard, seal limit 100, 60 blocks past the old trigger with history to fold; the maintenance hook fails the test ifCompactHistoryruns from inside a put, then an explicitCompressmust fold that history so the check is not vacuous. Fails without the fix, passes with it (13 s).go test ./...passes (22 min on a loaded box; the package ran past Go's default 10-minute timeout on the first try with no failures).🤖 Generated with Claude Code
https://claude.ai/code/session_015wUZmWRdAPtcfFgYrLJCc5