raft: Implement the PreVote RPC described in thesis section 9.6

This prevents disruption when a node that has been partitioned
away rejoins the cluster.

Fixes #6522
This commit is contained in:
Ben Darnell
2016-10-10 14:32:40 +08:00
parent ca87a13b18
commit 73cae7abd0
7 changed files with 482 additions and 198 deletions

View File

@ -93,6 +93,8 @@ func TestIsLocalMsg(t *testing.T) {
{pb.MsgTimeoutNow, false},
{pb.MsgReadIndex, false},
{pb.MsgReadIndexResp, false},
{pb.MsgPreVote, false},
{pb.MsgPreVoteResp, false},
}
for i, tt := range tests {