Repository navigation
test(goclusterfs): pace the uncommitted-blocks writer on the reader - #182
Merged
Merged
Conversation
TestReaderNeverSeesUncommittedBlocks required the reader to see at least 3 sizes while the writer filled 16 blocks, which depends on how the two are scheduled: with #160's narrower zeroing the writes were fast enough that the reader sometimes saw only 2, about 1 run in 20 on .68. After each block the writer now waits for a read that started after it, so the reader sees every block's size, while it keeps reading during the next block's writes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Waiting after every block made the test take 30 s under -race. Three waits, after each quarter of the file, are enough to show the reader three sizes. Co-Authored-By: Claude Opus 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.
TestReaderNeverSeesUncommittedBlocksfailed about 1 in 20 runs, and it was the test's timing check, not data exposure. The failure line, from the stale-reads session:lock_commit_test.go:196: node B saw the file at only 2 non-empty sizes while node A wrote itThe check required the reader to see at least 3 sizes while the writer filled 16 blocks, which depends on scheduling. Under #160's narrower zeroing the writes were fast enough to miss that. #162 reverted #160, so current main passed 1000 of 1000 for me on .68.
Fix: after each quarter of the file, the writer waits for a read that started after it, so the reader is shown at least 3 sizes. The reader keeps reading while the next quarter is written, so the uncommitted-block race is still exercised. The "read byte" check is unchanged.
200 runs each on .68, with tmpfs images as in the original report:
-race, median 11s against about 9s before)Pacing at every block also worked, but took 30s under
-race.🤖 Generated with Claude Code