Last week I stood up and gave a talk on the Raft Consensus Algorithm.
The first question I got was:
Doesn't it need an odd number of nodes?
I answered "During leader election, the first node to become a candidate, all the other nodes have to vote for. (Provided for that node the lack of heartbeat, timeout conditions have been triggered, and for the client nodes the candidate has an update to date term log). If two candidates arise at the same time, and neither gets a majority, each will fall back to a different random timeout, and the first to become a candidate (provided all the other criterion are met) will win. So you don't need an odd number of nodes to reach a majority, you just need to be the first candidate. Split votes are handled."
Immediately after this answer - I got the same question from a different person all over again.
So how does it reach consensus if it doesn't have an odd number of nodes?
My question is: What is the consensus algorithm that requires an odd number of nodes?
Here is an online publication that claims distributed systems need an odd number of nodes. (Spurious claim).
Partition tolerant consensus algorithms use an odd number of nodes (e.g. 3, 5 or 7). With just two nodes, it is not possible to have a clear majority after a failure. For example, if the number of nodes is three, then the system is resilient to one node failure; with five nodes the system is resilient to two node failures.