test(#834): rate-limit writers in TestMoveWithVarcharPK#835
Merged
Conversation
Uncapped tight-loop writers (4 goroutines, ~3 statements each, no delay) generate binlog faster than the move's reader can drain it on slow CI runners. Flush()'s BlockWait loop in pkg/repl/client.go never sees the delta queue fall below binlogTrivialThreshold because the source position keeps outrunning the buffered position. move.Run() never returns, writers never stop, wg.Wait() hangs, and the 10-minute Go test timeout fires. The 8.4 GA failure earlier today showed the reader ~460 binlog files behind the live source — same root cause, different subtest (queue-full-time vs force-enable-buffered-map in block#834). A 10ms sleep between iterations caps total throughput at ~400 ops/sec (~1200 statements/sec). The test exists to verify FIFO-queue replay correctness for VARCHAR PKs, not raw throughput, so pacing doesn't undermine its purpose. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Reduces flakiness/timeouts in TestMoveWithVarcharPK by pacing the concurrent writer goroutines so they can’t continuously outproduce the move’s binlog reader on slow CI runners.
Changes:
- Adds an explanatory comment describing the root cause of the timeout (issue #834) and why pacing is acceptable for this test.
- Inserts a
time.Sleep(10 * time.Millisecond)in the writer loop to cap write throughput and allowFlush()to converge.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aparajon
approved these changes
May 11, 2026
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.
Summary
Fixes #834 —
TestMoveWithVarcharPKtiming out at 10 minutes.The test runs 4 writer goroutines in an uncapped tight loop, each doing INSERT + UPDATE + (sometimes) DELETE per iteration with no delay. On slow CI runners this generates binlog faster than the move's reader can drain it. Inside
Flush()(pkg/repl/client.go:1000) the loop never seesGetDeltaLen() < binlogTrivialThresholdbecause the source position keeps outrunning the buffered position.move.Run()never returns → writers never stop →wg.Wait()hangs → the 10-minute Go test timeout fires.The MySQL 8.4 GA failure earlier today on
mainshowed the same symptom on the other subtest (queue-full-timevs theforce-enable-buffered-mapone in #834), with the reader ~460 binlog files behind the live source — same root cause.Fix
Add
time.Sleep(10 * time.Millisecond)between writer iterations. Caps total throughput at ~400 ops/sec (~1200 statements/sec). The test exists to verify FIFO-queue replay correctness for VARCHAR PKs, not raw throughput, so pacing doesn't undermine its purpose.Test plan
🤖 Generated with Claude Code