Content deleted Content added
Clinamental (talk | contribs) m Spelling, per context. |
|||
Line 12:
When the existing leader fails or when you start your algorithm, a new leader needs to be elected.
In this case, a new ''term'' starts in the cluster. A term is an arbitrary period of time on the server
A leader election is started by a ''candidate'' server. A server becomes a candidate if it receives no communication by the leader over a period called the ''election timeout'', so it assumes there is no acting leader anymore. It starts the election by increasing the term counter, voting for itself as new leader, and sending a message to all other servers requesting their vote. A server will vote only once per term, on a first-come-first-served basis. If a candidate receives a message from another server with a term number at least as large as the candidate's current term, then its election is defeated and the candidate changes into a follower and
Raft uses randomized election timeout to ensure that split votes problem are resolved quickly. This should reduce the chance of a split vote because servers won't become candidates at the same time : a single server will timeout, win the election, then become leader and sends heartbeat messages to other servers before any of the followers can become candidates.<ref name="paper" />
|