Browse Source

raft: reset votes when becomePreCandidate

gladiator 8 years ago
parent
commit
3740793b42
1 changed files with 1 additions and 0 deletions
  1. 1 0
      raft/raft.go

+ 1 - 0
raft/raft.go

@@ -611,6 +611,7 @@ func (r *raft) becomePreCandidate() {
 	// but doesn't change anything else. In particular it does not increase
 	// r.Term or change r.Vote.
 	r.step = stepCandidate
+	r.votes = make(map[uint64]bool)
 	r.tick = r.tickElection
 	r.state = StatePreCandidate
 	r.logger.Infof("%x became pre-candidate at term %d", r.id, r.Term)