Candidate does not distinguish between votes from same follower #45

Open
schuster opened this Issue Apr 15, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@schuster

The Candidate state does not distinguish between multiple votes in the same term from the same follower, although it should. Otherwise, a candidate might get elected by the same follower (this will only happen if bug #29 is fixed as well to allow multiple votes from same follower).

@ktoso ktoso added the protocol-fix label Apr 15, 2015

@colin-scott

This comment has been minimized.

Show comment
Hide comment
@colin-scott

colin-scott Aug 2, 2015

Contributor

Update: this issue does not depend on #29 being fixed. I was able to trigger it as follows:

  • Candidate starts election in Term(1), sends RequestVote message to all peers
  • Follower receives RequestVote, responds with VoteCandidate
  • Candidate receives ElectionTimeout [before receiving VoteCandidate], increments its Term, sends RequestVote message to all peers.
  • Same follower receives RequestVote, responds with VoteCandidate
  • Now Candidate may receive two VoteCandidates from the same Follower.

Combined with #46 , this means that it's possible for two leaders to be elected in the same Term.

Contributor

colin-scott commented Aug 2, 2015

Update: this issue does not depend on #29 being fixed. I was able to trigger it as follows:

  • Candidate starts election in Term(1), sends RequestVote message to all peers
  • Follower receives RequestVote, responds with VoteCandidate
  • Candidate receives ElectionTimeout [before receiving VoteCandidate], increments its Term, sends RequestVote message to all peers.
  • Same follower receives RequestVote, responds with VoteCandidate
  • Now Candidate may receive two VoteCandidates from the same Follower.

Combined with #46 , this means that it's possible for two leaders to be elected in the same Term.

@colin-scott

This comment has been minimized.

Show comment
Hide comment
@colin-scott

colin-scott Aug 8, 2015

Contributor

For what it's worth, I have a (non-pull-request-worthy) fix for this issue here:

NetSys/demi-applications@5130f1f

Contributor

colin-scott commented Aug 8, 2015

For what it's worth, I have a (non-pull-request-worthy) fix for this issue here:

NetSys/demi-applications@5130f1f

@ktoso ktoso modified the milestone: 1.0 Aug 9, 2015

@colin-scott colin-scott referenced this issue Aug 14, 2015

Open

Raft 45 #70

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment