• Willem Thiart's avatar
    Fix voted_for bug · daa93cb1
    Willem Thiart authored
    Reproduction:
    
    Three node configuration without randomized election timeouts.
    
    1. Node 1 and Node 2 both start elections.
    2. Node 2 gets a vote from node 3 and transitions to leader (majority votes 2/3 including itself)
    3. Node 2 then gets a requestvote from node 1
    
    This causes the raft_is_leader(me_) to be true and the assertion to fire.
    
    Thanks to @ar104 for the fix!
    daa93cb1
raft_server.c 16.4 KB