ktoso / akka-raft

A toy project implementing RAFT on top of Akka Cluster (not prod ready)
http://blog.project13.pl
Apache License 2.0
280 stars 42 forks source link

Candidate does not distinguish between votes from same follower #45

Open schuster opened 9 years ago

schuster commented 9 years ago

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).

colin-scott commented 9 years ago

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

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

colin-scott commented 9 years ago

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

https://github.com/NetSys/sts2-applications/commit/5130f1f51a931a86687c8bf80f014e2dfc9e2bbd