Repository navigation
Conversation
|
At our stand, the situation turned out to be that the nodes spread to different views and could not restore their functionality. |
Thanks for this. Before we look at the fix itself, here are some notes on How I checked: I copied
Only two of the six tests fail on
Keep, with fixes
For both: assert each group's view with Tests that don't exercise the fix
Why are these two needed in this PR? They pass both on
If they're meant to document current behaviour, please fix the comments and the recovery check. Otherwise they may not belong in this PR.
General
Flakiness:
I'll comment on the fix itself separately. |
Thank you very much. Don't comment on the correction yet. I need to finalize the split test first. |
A node that fell behind a view change - because it restarted, lost messages or was cut off while the rest of the cluster moved on - could never rejoin. It stayed in its old view, and a view change only accepts messages for the view immediately after it. The cluster had already moved further and no longer announced that view, so nothing could tell the node where it went. Sync was supposed to, but it compared numbers from different frames of reference: ViewSequences held the sequence that had just been decided, not the one the view was about to propose, and the state transfer response carried the same decided sequence. A node behind the cluster by exactly the proposal in flight got the new view at a sequence that had already been decided, and went silent forever. Publish the next proposal sequence in ViewSequences as soon as the view moves on to it, so that the heartbeat a leader broadcasts, the sequence a node reports when its state is collected, and the sequence a follower compares its own against are all the same number. A node that hears a quorum of distinct senders (f+1) announce a view beyond the one it is in now syncs to find out where the cluster is, at most once per announced view, so a faulty sender cannot make it sync indefinitely. The announcement only triggers the sync; the view itself is adopted through the authenticated new view message. The per-view sync bookkeeping is reset through a single helper on every path where the view changes, including restore from the log. The split and restart scenarios are covered end to end by the tests in test/view_split_test.go. Signed-off-by: Fedor Partanskiy <fredprtnsk@gmail.com>
961b575 to
9ac3e18
Compare
I've removed the extra tests. I have corrected the remaining ones, please take a look at them or there are more comments on them. |
A node that fell behind a view change - because it restarted, lost messages or was cut off while the rest of the cluster moved on - could never rejoin. It stayed in its old view, and a view change only accepts messages for the view immediately after it. The cluster had already moved further and no longer announced that view, so nothing could tell the node where it went. Sync was supposed to, but it compared numbers from different frames of reference: ViewSequences held the sequence that had just been decided, not the one the view was about to propose, and the state transfer response carried the same decided sequence. A node behind the cluster by exactly the proposal in flight got the new view at a sequence that had already been decided, and went silent forever.
Publish the next proposal sequence in ViewSequences as soon as the view moves on to it, so that the heartbeat a leader broadcasts, the sequence a node reports when its state is collected, and the sequence a follower compares its own against are all the same number.
A node that hears a quorum of distinct senders (f+1) announce a view beyond the one it is in now syncs to find out where the cluster is, at most once per announced view, so a faulty sender cannot make it sync indefinitely. The announcement only triggers the sync; the view itself is adopted through the authenticated new view message. The per-view sync bookkeeping is reset through a single helper on every path where the view changes, including restore from the log.
The split and restart scenarios are covered end to end by the tests in test/view_split_test.go.