Skip to content

Commit 7b96f3d

Browse files
committed
Update the description according to the review comments
Part of #2593
1 parent c50cce2 commit 7b96f3d

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

doc/book/replication/repl_leader_elect.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,17 @@ All the non-leader nodes are called *followers*. The nodes that start a new
7474
election round are called *candidates*. The elected leader sends heartbeats to
7575
the non-leader nodes to let them know it is alive.
7676

77-
In case there are no heartbeats for a period set by the :ref:`replication_timeout <cfg_replication-replication_timeout>` option,
77+
In case there are no heartbeats for the period of :ref:`replication_timeout <cfg_replication-replication_timeout>` * 4,
7878
a non-leader node starts a new election if the following conditions are met:
7979

80-
* It has a quorum of connections to other cluster members.
80+
* The node has a quorum of connections to other cluster members.
8181
* None of these cluster members can see the leader node.
8282

83+
.. note::
84+
85+
A cluster member considers the leader node to be alive if the member received heartbeats from the leader at least once during the period of ``replication_timeout * 4`,
86+
and there are no replication errors (the connection is not broken due to timeout or due to an error).
87+
8388
Terms and votes are persisted by each instance to preserve certain Raft guarantees.
8489
8590
During the election, the nodes prefer to vote for those ones that have the
@@ -127,7 +132,7 @@ Configuration
127132
Heartbeats sent by an active leader have a timeout after which a new election
128133
starts. Heartbeats are sent once per <replication_timeout> seconds.
129134
Default value is ``1``. The leader is considered dead if it hasn't sent any
130-
heartbeats for the period of ``<replication_timeout> * 4``.
135+
heartbeats for the period of ``replication_timeout * 4``.
131136
* ``replication_synchro_quorum`` -- reuse of the :ref:`replication_synchro_quorum <cfg_replication-replication_synchro_quorum>`
132137
option for the purpose of configuring the election quorum. The default value is ``1``,
133138
meaning that each node becomes a leader immediately after voting for itself.

doc/reference/reference_lua/box_info/election.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ box.info.election
2020

2121
* ``term`` -- current election term.
2222

23-
* ``vote`` -- ID of a node the current node votes for. If the value is ``0``, it means the node doesn't vote in the current term.
23+
* ``vote`` -- ID of a node the current node votes for. If the value is ``0``, it means the node hasn't voted in the current term yet.
2424

2525
* ``leader`` -- leader node ID in the current term. If the value is ``0``, it means the node doesn't know which node is the leader in the current term.
2626

0 commit comments

Comments
 (0)