Content deleted Content added
→Basics: fmt |
|||
Line 11:
The consensus problem is decomposed in Raft into two relatively independent subproblems listed down below.
==== Leader
When the existing leader fails or when you start your algorithm, a new leader needs to be elected.
Line 20:
Raft uses a randomized election timeout to ensure that split vote problems 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 time out, win the election, then become leader and send heartbeat messages to other servers before any of the followers can become candidates.<ref name="paper" />
==== Log
The leader is responsible for the log replication. It accepts client requests. Each client request consists of a command to be executed by the replicated state machines in the cluster. After being appended to the leader's log as a new entry, each of the requests is forwarded to the followers as AppendEntries messages. In case of unavailability of the followers, the leader retries AppendEntries messages indefinitely, until the log entry is eventually stored by all of the followers.
|