mirror of
https://github.com/talent-plan/tinykv.git
synced 2026-08-19 13:03:28 +08:00
@@ -1029,9 +1029,9 @@ func TestProvideSnap2C(t *testing.T) {
|
||||
sm.becomeLeader()
|
||||
sm.readMessages() // clear message
|
||||
|
||||
// force set the next of node 2, so that node 2 needs a snapshot
|
||||
sm.Prs[2].Next = 0
|
||||
sm.Step(pb.Message{From: 2, To: 1, Term: 1, MsgType: pb.MessageType_MsgAppendResponse, Index: sm.Prs[2].Next - 1, Reject: true})
|
||||
// force set the next of node 2 to less than the SnapshotMetadata.Index, so that node 2 needs a snapshot
|
||||
sm.Prs[2].Next = 10
|
||||
sm.Step(pb.Message{From: 2, To: 1, MsgType: pb.MessageType_MsgPropose, Entries: []*pb.Entry{{Data: []byte("somedata")}}})
|
||||
|
||||
msgs := sm.readMessages()
|
||||
if len(msgs) != 1 {
|
||||
|
||||
Reference in New Issue
Block a user