In case of network partitions, Raft stays consistent. But what does happen if only a single node loses contact only to the leader, becomes a candidate and calls for votes?
This is the setup, I adjusted the examples from http://thesecretlivesofdata.com/raft/ to fit my needs:
Node B
is the current leader and sends out heartbeats (red) to the followers. The connection between B
and C
gets lost and after the election timeout C
becomes a candidate, votes for itself and asks nodes A
, D
and E
to vote for it (green).
What does happen?
As far as I understand Raft, nodes A
, D
and E
should vote for C
which makes C
the next leader (Term 2). We then have two leaders each sending out heartbeats, and hopefully nodes A
, D
and E
will ignore those from B
because of the lower term.
Is this correct or is there some better mechanism?