Skip to content

Commit 8eac966

Browse files
authored
feedback: add fixes (#3613)
* Fixes #3552 - fix broken link * Fix translation and wording
1 parent 9918cb3 commit 8eac966

File tree

5 files changed

+59
-46
lines changed

5 files changed

+59
-46
lines changed

doc/concepts/replication/repl_leader_elect.rst

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ in the cluster but don't use synchronous spaces at all.
3939
Synchronous replication has a separate :ref:`documentation section <repl_sync>`.
4040
Leader election is described below.
4141

42+
.. note::
43+
44+
The system behavior can be specified exactly according to the Raft algorithm. To do this:
45+
46+
* Ensure that the user has only synchronous spaces.
47+
* Set the :ref:`replication_synchro_quorum <repl_leader_elect_config>` option to ``N / 2 + 1``.
48+
* Set the :ref:`replication_synchro_timeout <cfg_replication-replication_synchro_timeout>` option to infinity.
49+
* In the :ref:`election_fencing_mode <repl_leader_elect_config>` option, select either the ``soft`` mode (the default)
50+
or the ``strict`` mode, which is more restrictive.
51+
4252
.. _repl_leader_elect_process:
4353

4454
Leader election process
@@ -56,7 +66,7 @@ After the first boot, each node has its term equal to 1. When a node sees that
5666
it is not a leader and there is no leader available for some time in the replica
5767
set, it increases the term and starts a new leader election round.
5868

59-
Leader election happens via votes. The node, which started the election, votes
69+
Leader election happens via votes. The node that started the election votes
6070
for itself and sends vote requests to other nodes.
6171
Upon receiving vote requests, a node votes for the first of them, and then cannot
6272
do anything in the same term but wait for a leader to be elected.
@@ -67,7 +77,7 @@ and notifies other nodes about that. Also, a split vote can happen
6777
when no nodes received a quorum of votes. In this case,
6878
after a :ref:`random timeout <repl_leader_elect_config>`,
6979
each node increases its term and starts a new election round if no new vote
70-
request with a greater term arrives during this time period.
80+
request with a greater term arrives during this time.
7181
Eventually, a leader is elected.
7282

7383
If any unfinalized synchronous transactions are left from the previous leader,
@@ -85,7 +95,8 @@ a non-leader node starts a new election if the following conditions are met:
8595

8696
.. note::
8797

88-
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``,
98+
A cluster member considers the leader node to be alive if the member received heartbeats from the leader at least
99+
once during the ``replication_timeout * 4``,
89100
and there are no replication errors (the connection is not broken due to timeout or due to an error).
90101

91102
Terms and votes are persisted by each instance to preserve certain Raft guarantees.
@@ -136,12 +147,11 @@ Once noticing the error, a user can choose any representative from each of the s
136147
To correlate the data, the user should remove it from the nodes of one set,
137148
and reconnect them to the nodes from the other set that have the correct data.
138149

139-
Also, if election is enabled on the node, it won't replicate from any nodes except
150+
Also, if election is enabled on the node, it doesn't replicate from any nodes except
140151
the newest leader. This is done to avoid the issue when a new leader is elected,
141152
but the old leader has somehow survived and tries to send more changes
142153
to the other nodes.
143154

144155
Term numbers also work as a kind of filter.
145-
For example, you can be sure that if election
146-
is enabled on two nodes and ``node1`` has the term number less than ``node2``,
147-
then ``node2`` won't accept any transactions from ``node1``.
156+
For example, if election is enabled on two nodes and ``node1`` has the term number less than ``node2``,
157+
then ``node2`` doesn't accept any transactions from ``node1``.

doc/how-to/replication/repl_leader_elect.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,35 +80,35 @@ refer to the :doc:`function description </reference/reference_lua/box_info/elect
8080
8181
The Raft-based election implementation logs all its actions
8282
with the ``RAFT:`` prefix. The actions are new Raft message handling,
83-
node state changing, voting, term bumping, and so on.
83+
node state changing, voting, and term bumping.
8484

8585
.. _repl_leader_elect_important:
8686

8787
Important notes
8888
---------------
8989

90-
Leader election won't work correctly if the election quorum is set to less or equal
90+
Leader election doesn't work correctly if the election quorum is set to less or equal
9191
than ``<cluster size> / 2`` because in that case, a split vote can lead to
9292
a state when two leaders are elected at once.
9393

94-
For example, let's assume there are five nodes. When the quorum is set to ``2``, ``node1``
94+
For example, suppose there are five nodes. When the quorum is set to ``2``, ``node1``
9595
and ``node2`` can both vote for ``node1``. ``node3`` and ``node4`` can both vote
9696
for ``node5``. In this case, ``node1`` and ``node5`` both win the election.
9797
When the quorum is set to the cluster majority, that is
98-
``(<cluster size> / 2) + 1`` or bigger, the split vote is not possible.
98+
``(<cluster size> / 2) + 1`` or greater, the split vote is impossible.
9999

100100
That should be considered when adding new nodes.
101101
If the majority value is changing, it's better to update the quorum on all the existing nodes
102102
before adding a new one.
103103

104-
Also, the automated leader election won't bring many benefits in terms of data
104+
Also, the automated leader election doesn't bring many benefits in terms of data
105105
safety when used *without* :ref:`synchronous replication <repl_sync>`.
106106
If the replication is asynchronous and a new leader gets elected,
107107
the old leader is still active and considers itself the leader.
108108
In such case, nothing stops
109109
it from accepting requests from clients and making transactions.
110-
Non-synchronous transactions will be successfully committed because
111-
they won't be checked against the quorum of replicas.
112-
Synchronous transactions will fail because they won't be able
113-
to collect the quorum -- most of the replicas will reject
110+
Non-synchronous transactions are successfully committed because
111+
they are not checked against the quorum of replicas.
112+
Synchronous transactions fail because they are not able
113+
to collect the quorum -- most of the replicas reject
114114
these old leader's transactions since it is not a leader anymore.

doc/reference/reference_lua/errcodes.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
Database error codes
55
-------------------------------------------------------------------------------
66

7-
In the current version of the binary protocol, error messages, which are normally
7+
In the current version of the binary protocol, error messages, which are usually
88
more descriptive than error codes, are not present in server responses. The actual
9-
message may contain a file name, a detailed reason or operating system error code.
9+
message may contain a filename, a detailed reason or operating system error code.
1010
All such messages, however, are logged in the error log. Below are general
1111
descriptions of some popular codes. A complete list of errors can be found in file
12-
`errcode.h <https://github.com/tarantool/tarantool/blob/2.1/src/box/errcode.h>`_ in the source tree.
12+
`errcode.h <https://github.com/tarantool/tarantool/blob/master/src/box/error.h>`_ in the source tree.
1313

1414
.. container:: table
1515

@@ -122,15 +122,15 @@ For example consider the :ref:`fio_read.lua <cookbook-fio_read>` program in our
122122
f:close()
123123
print(data)
124124
125-
After a function call that might fail, like fio.open() above,
125+
After a function call that might fail, like ``fio.open()`` above,
126126
it is common to see syntax like ``if not f then ...``
127127
or ``if f == nil then ...``, which check
128128
for common failures. But if there had been a syntax
129129
error, for example fio.opex instead of fio.open, then
130130
there would have been a Lua error and f would not have
131131
been changed. If checking for such an obvious error
132132
had been a concern, the programmer would probably have
133-
used pcall().
133+
used ``pcall()``.
134134

135135
All functions in Tarantool modules should work this way,
136136
unless the manual explicitly says otherwise.

locale/ru/LC_MESSAGES/concepts/replication/repl_leader_elect.po

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgid ""
66
"Starting from version :doc:`2.6.1 </release/2.6.1>`, Tarantool has the "
77
"built-in functionality managing automated *leader election* in a replica "
88
"set. This functionality increases the fault tolerance of the systems built "
9-
"on the base of Tarantool and decreases dependency on the external tools for "
9+
"on the base of Tarantool and decreases dependency on external tools for "
1010
"replica set management."
1111
msgstr ""
1212
"В Tarantool, начиная с версии :doc:`2.6.1 </release/2.6.1>`, есть встроенная"
@@ -16,8 +16,8 @@ msgstr ""
1616
"снижает зависимость от внешних инструментов для управления набором реплик."
1717

1818
msgid ""
19-
"To learn how to configure and monitor automated leader elections,
20-
check the :ref:`how-to guide <how-to-repl_leader_elect>`."
19+
"To learn how to configure and monitor automated leader elections, "
20+
"check the :ref:`how-to guide <how-to-repl_leader_elect>`."
2121
msgstr ""
2222
"Чтобы узнать, как настраивать и отслеживать автоматические выборы лидера, "
2323
"прочитайте :ref:`практическое руководство <how-to-repl_leader_elect>`."
@@ -88,25 +88,27 @@ msgstr ""
8888
"своего терма и начинает новый тур выборов."
8989

9090
msgid ""
91-
"Leader election happens via votes. The node which started the election votes"
91+
"Leader election happens via votes. The node that started the election votes"
9292
" for itself and sends vote requests to other nodes. Upon receiving vote "
9393
"requests, a node votes for the first of them, and then cannot do anything in"
94-
" the same term but wait for a leader being elected."
94+
" the same term but wait for a leader to be elected."
9595
msgstr ""
9696
"Выборы лидера происходят посредством голосования. Узел, начинающий выборы, "
9797
"голосует сам за себя и отправляет другим запросы на голос. Каждый экземпляр "
9898
"голосует за первый узел, от которого пришел такой запрос, и далее в течение "
9999
"всего терма ожидает избрания лидера, не выполняя никаких действий."
100100

101101
msgid ""
102-
"The node that collected a :ref:`quorum of votes <repl_leader_elect_config>` "
102+
"The node that collected a quorum of votes defined by the "
103+
":ref:`replication_synchro_quorum <repl_leader_elect_config>` parameter "
103104
"becomes the leader and notifies other nodes about that. Also, a split vote "
104105
"can happen when no nodes received a quorum of votes. In this case, after a "
105106
":ref:`random timeout <repl_leader_elect_config>`, each node increases its "
106107
"term and starts a new election round if no new vote request with a greater "
107-
"term arrives during this time period. Eventually, a leader is elected."
108+
"term arrives during this time. Eventually, a leader is elected."
108109
msgstr ""
109-
"Узел, собравший :ref:`кворум голосов <repl_leader_elect_config>`, становится"
110+
"Узел, собравший кворум голосов "
111+
":ref:`replication_synchro_quorum <repl_leader_elect_config>`, становится"
110112
" лидером и оповещает об этом другие узлы. Голоса могут разделиться, если ни "
111113
"один узел не получит кворума. В этом случае спустя :ref:`случайное время "
112114
"<repl_leader_elect_config>` происходят перевыборы: каждый узел увеличивает "
@@ -116,21 +118,22 @@ msgstr ""
116118

117119
msgid ""
118120
"All the non-leader nodes are called *followers*. The nodes that start a new "
119-
"election round are called *candidates*. The elected leader sends heartbeats "
120-
"to the non-leader nodes to let them know it is alive. So if there are no "
121-
"heartbeats for a period set by the :ref:`replication_timeout "
122-
"<cfg_replication-replication_timeout>` option, a new election starts. Terms "
123-
"and votes are persisted by each instance in order to preserve certain Raft "
124-
"guarantees."
121+
"election round are alled *candidates*. The elected leader sends heartbeats "
122+
"to the non-leader nodes to let them know it is alive."
125123
msgstr ""
126124
"Узлы, не являющиеся лидерами, называются *последователями* (followers). "
127125
"Узлы, которые начинают новый тур выборов, называются *кандидатами* "
128126
"(candidates). Избранный лидер отправляет остальным узлам контрольные сигналы"
129-
" (heartbeats), оповещая о том, что он работает (alive). Если контрольные "
130-
"сигналы не приходят в течение времени, заданного параметром "
131-
":ref:`replication_timeout <cfg_replication-replication_timeout>`, начинаются"
132-
" новые выборы. Чтобы алгоритм Raft гарантированно выполнялся, термы и голоса"
133-
" сохраняются на каждом экземпляре."
127+
" (heartbeats), оповещая о том, что он работает (alive)."
128+
129+
msgid ""
130+
"In case there are no heartbeats for the period of "
131+
":ref:`replication_timeout <cfg_replication-replication_timeout>` * 4, "
132+
"a non-leader node starts a new election if the following conditions are met: "
133+
msgstr ""
134+
"Если контрольные сигналы не приходят в течение периода времени "
135+
":ref:`replication_timeout <cfg_replication-replication_timeout>` * 4, узел, "
136+
"не являющийся лидером, начинает новые выборы при соблюдении следующих условий: "
134137

135138
msgid ""
136139
"During the election, the nodes prefer to vote for those ones that have the "
@@ -145,7 +148,7 @@ msgid ""
145148
"When :ref:`election is enabled <repl_leader_elect_config>`, there must be "
146149
"connections between each node pair so as it would be the full mesh topology."
147150
" This is needed because election messages for voting and other internal "
148-
"things need direct connection between the nodes."
151+
"things need a direct connection between the nodes."
149152
msgstr ""
150153
"Необходимо, чтобы все узлы, :ref:`включенные в процесс выборов "
151154
"<repl_leader_elect_config>`, были соединены попарно и образовывали полную "
@@ -154,7 +157,7 @@ msgstr ""
154157
"узлами."
155158

156159
msgid ""
157-
"Also, if election is enabled on the node, it won't replicate from any nodes "
160+
"Also, if election is enabled on the node, it doesn't replicate from any nodes "
158161
"except the newest leader. This is done to avoid the issue when a new leader "
159162
"is elected, but the old leader has somehow survived and tries to send more "
160163
"changes to the other nodes."
@@ -165,9 +168,9 @@ msgstr ""
165168
"реплики."
166169

167170
msgid ""
168-
"Term numbers also work as a kind of a filter. For example, you can be sure "
169-
"that if election is enabled on two nodes and ``node1`` has the term number "
170-
"less than ``node2``, then ``node2`` won't accept any transactions from "
171+
"Term numbers also work as a kind of filter. For example, "
172+
"if election is enabled on two nodes and ``node1`` has the term number "
173+
"less than ``node2``, then ``node2`` doesn't accept any transactions from "
171174
"``node1``."
172175
msgstr ""
173176
"Числовые значения термов также выполняют функцию своеобразного фильтра. "

locale/ru/LC_MESSAGES/reference/reference_lua/errcodes.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ msgid ""
99
"operating system error code. All such messages, however, are logged in the "
1010
"error log. Below are general descriptions of some popular codes. A complete "
1111
"list of errors can be found in file `errcode.h "
12-
"<https://github.com/tarantool/tarantool/blob/2.1/src/box/errcode.h>`_ in the"
12+
"<https://github.com/tarantool/tarantool/blob/master/src/box/errcode.h>`_ in the"
1313
" source tree."
1414
msgstr ""
1515

0 commit comments

Comments
 (0)