Repository navigation
raftcore: a wake restarts the idle minute, so a write's learner deliveries are not discarded - #2224
Merged
Merged
Conversation
wakeScheduling set s.active to s.now, the time of the last Schedule. A group that slept for an hour therefore looked idle as soon as a write woke it, prepared its sleep marker on the next turn, and at that sleep boundary Router.Quiesce discarded the write's deliveries to learners. The other computer stayed behind until something woke the group again. Red: TestWakeRestartsTheIdleWindowFromTheNextLook (Barrier:true after a write). IdleRead keeps its existing exemption, so it cannot hold the group awake.
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.
A second computer could miss a committed change until something next woke the group. This showed up as
R9 learner did not reach its applied stateinTestR26R27C30OpenLearnerIdleAndStateWake.Cause.
wakeSchedulingsets.active = s.now, ands.nowis the time of the lastSchedulecall. After a long sleep that time is old, so a group woken by a write looked idle at once. It then prepared its sleep marker on the next maintenance turn. At that sleep boundaryRouter.Quiescediscards deliveries queued for learners, including the write's own, and a learner that had not drained its queue stayed behind.Evidence. In a failing run the learner stood at commit 17 and its peer at 18. Advancing the clock 40 more times (20 virtual seconds) did not help. In a run of 96 under load, all 5 failures had Quiesce drops to the learners after the idle window, and none of the 91 passes did.
Change. The idle minute now restarts at the first
Scheduleafter a wake.IdleReadkeeps its existing exemption, so it cannot hold a group awake.Validation
TestWakeRestartsTheIdleWindowFromTheNextLookgotBarrier:truestraight after a write. It also checks that the group prepares to sleep again after a full idle minute.raftcorescheduler tests and theraftdirectoryquiescence and idle tests pass. The full gate is left to the merge batch.Limits
Quiescebehaviour and this PR does not change it.🤖 Generated with Claude Code