diff --git a/raft/doc.go b/raft/doc.go index 034819be6..c6cc931d5 100644 --- a/raft/doc.go +++ b/raft/doc.go @@ -75,7 +75,7 @@ raftpb.EntryConfChange will be returned. You should apply it to node through: cc.Unmarshal(data) n.ApplyConfChange(cc) -Note: One ID represents one unique node in a cluster. A given ID MUST be used +Note: An ID represents a unique node in a cluster. A given ID MUST be used only once even if the old node has been removed. */ diff --git a/raft/raft_test.go b/raft/raft_test.go index ba400f15a..ef09f556b 100644 --- a/raft/raft_test.go +++ b/raft/raft_test.go @@ -986,7 +986,7 @@ func TestRecoverDoublePendingConfig(t *testing.T) { }() } -// TestAddNode tests that addNode could update pendingConf and peer list correctly. +// TestAddNode tests that addNode could update pendingConf and nodes correctly. func TestAddNode(t *testing.T) { r := newRaft(1, []int64{1}, 0, 0) r.pendingConf = true @@ -1002,8 +1002,8 @@ func TestAddNode(t *testing.T) { } } -// TestRemoveNode tests that removeNode could update pendingConf, peer list, -// removed correctly. +// TestRemoveNode tests that removeNode could update pendingConf, nodes and +// and removed list correctly. func TestRemoveNode(t *testing.T) { r := newRaft(1, []int64{1, 2}, 0, 0) r.pendingConf = true @@ -1021,8 +1021,8 @@ func TestRemoveNode(t *testing.T) { } } -// TestRecvMsgDenied tests that state machine sets removed when handling -// msgDenied, and does not pass it to the actual stepX function. +// TestRecvMsgDenied tests that state machine sets the removed list when +// handling msgDenied, and does not pass it to the actual stepX function. func TestRecvMsgDenied(t *testing.T) { called := false fakeStep := func(r *raft, m pb.Message) {