raft/rafttest: fix stabilize handler

It was bailing out too early.
This commit is contained in:
Tobias Schottdorf 2019-08-14 17:24:14 +02:00
parent d047fe84ee
commit c2d9514370
2 changed files with 19 additions and 4 deletions

View File

@ -73,12 +73,12 @@ func (env *InteractionEnv) Stabilize(idxs ...int) error {
withIndent(func() { env.DeliverMsgs(msgs) }) withIndent(func() { env.DeliverMsgs(msgs) })
done = false done = false
} }
}
if done { if done {
return nil return nil
} }
} }
} }
}
func splitMsgs(msgs []raftpb.Message, to uint64) (toMsgs []raftpb.Message, rmdr []raftpb.Message) { func splitMsgs(msgs []raftpb.Message, to uint64) (toMsgs []raftpb.Message, rmdr []raftpb.Message) {
for _, msg := range msgs { for _, msg := range msgs {

View File

@ -136,6 +136,21 @@ status 1
2: StateReplicate match=11 next=12 2: StateReplicate match=11 next=12
3: StateReplicate match=11 next=12 3: StateReplicate match=11 next=12
# Let things settle.
stabilize stabilize
---- ----
ok > delivering messages
1->2 MsgHeartbeat Term:1 Log:0/0 Commit:11
> delivering messages
1->3 MsgApp Term:1 Log:1/11 Commit:11
> 2 handling Ready
Ready MustSync=false:
Messages:
2->1 MsgHeartbeatResp Term:1 Log:0/0
> 3 handling Ready
Ready MustSync=false:
Messages:
3->1 MsgAppResp Term:1 Log:0/11
> delivering messages
2->1 MsgHeartbeatResp Term:1 Log:0/0
3->1 MsgAppResp Term:1 Log:0/11