The command processes the vote request then stores it without any synchronization. This can lead to the following sequence:
- Host A requests a vote for term 5 which we grant
- Host B requests a vote for term 6 which we grant
- Record that we voted for host B in term 6
- Record that we voted for host A in term 5
Since we record votes using overwrite updates, the term 5 vote replaces the term 6 vote so we lose the fact that we already voted in term 6. Since we only read that document at startup, this can only result in conflicting votes if a shutdown occurs before we vote again. Unlike
SERVER-27154 this can still happen with a clean shutdown.