Skip to content

Commit 9a052ea

Browse files
committed
DOCS-11925: electionTimeoutMillis parameter
1 parent f8e8315 commit 9a052ea

File tree

8 files changed

+85
-4
lines changed

8 files changed

+85
-4
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ref: rs-stepdown-election-handoff
2+
content: |
3+
4+
.. versionchanged:: 4.0.2
5+
6+
If the parameter :parameter:`enableElectionHandoff` is true
7+
(default), when a primary steps down from :method:`rs.stepDown()`
8+
(or the :dbcommand:`replSetStepDown` command without the ``force:
9+
true``), the stepped-down primary nominates an eligible secondary
10+
to call an election immediately. Otherwise, secondaries can wait
11+
up to :rsconf:`settings.electionTimeoutMillis` before calling an
12+
election. The stepped down primary does not wait for the effects
13+
of the handoff. For more information, see
14+
:parameter:`enableElectionHandoff`.
15+
...

source/includes/fact-stepdown-write-fail.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All writes to the primary fail during the period starting when the
44
|command-method-name| |command-method| is received until either a new
5-
primary is elected, or if there are no electible secondaries, the
5+
primary is elected, or if there are no electable secondaries, the
66
original primary resumes normal operation. The time period where
77
writes fail is at maximum:
88

source/includes/stepdown-behavior.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
.. versionadded:: 3.0
22

3+
Concurrent Operations
4+
~~~~~~~~~~~~~~~~~~~~~
5+
36
The |command-method-name| |command-method| attempts to
47
terminate long running user operations that block the primary
58
from stepping down, such as an index build, a write operation or a
69
map-reduce job.
710

11+
Availability of Eligible Secondaries
12+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13+
814
The |command-method| then initiates a catchup period where it waits up to
915
``secondaryCatchUpPeriodSeconds``, by default 10 seconds, for a
1016
secondary to become up-to-date with the primary. The primary only steps
@@ -17,8 +23,12 @@ period, the primary does not step down and the |command-method| errors.
1723

1824
Once the primary steps down successfully, that node cannot become the
1925
primary for the remainder of the |stepdown-secs| period,
20-
which began when the node received the |command-method|. The
21-
|command-method-name| |command-method| forces all clients currently
26+
which began when the node received the |command-method|.
27+
28+
Client Connections
29+
~~~~~~~~~~~~~~~~~~
30+
31+
The |command-method-name| |command-method| forces all clients currently
2232
connected to the database to disconnect. This helps ensure that the
2333
clients maintain an accurate view of the replica set.
2434

source/reference/command/replSetStepDown.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,16 @@ Behavior
4747

4848
.. include:: /includes/stepdown-behavior.rst
4949

50+
Writes During Stepdown
51+
~~~~~~~~~~~~~~~~~~~~~~
52+
5053
.. include:: /includes/fact-stepdown-write-fail.rst
5154

55+
Election Handoff
56+
~~~~~~~~~~~~~~~~
57+
58+
.. include:: /includes/extracts/rs-stepdown-election-handoff.rst
59+
5260
Examples
5361
--------
5462

source/reference/method/rs.stepDown.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,13 @@ Behavior
3939

4040
.. include:: /includes/stepdown-behavior.rst
4141

42+
Writes During Stepdown
43+
~~~~~~~~~~~~~~~~~~~~~~
44+
4245
.. include:: /includes/fact-stepdown-write-fail.rst
46+
47+
Election Handoff
48+
~~~~~~~~~~~~~~~~
49+
50+
.. include:: /includes/extracts/rs-stepdown-election-handoff.rst
51+

source/reference/parameters.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,37 @@ Replication Parameters
14041404

14051405
For more information, see :ref:`rollback-data-files`.
14061406

1407+
.. parameter:: enableElectionHandoff
1408+
1409+
.. versionadded:: 4.0.2
1410+
1411+
*Type*: boolean
1412+
1413+
*Default*: true
1414+
1415+
A flag that can reduce the downtime after the primary steps down
1416+
from either the :method:`rs.stepDown()` method or the
1417+
:dbcommand:`replSetStepDown` command. Specifically, if true, when a
1418+
primary steps down after :method:`rs.stepDown()` (or the
1419+
:dbcommand:`replSetStepDown` command without the ``force: true``),
1420+
it nominates an eligible secondary to call an election immediately.
1421+
If false, after the step down, secondaries can wait up to
1422+
:rsconf:`settings.electionTimeoutMillis` before calling an election.
1423+
1424+
An eligible secondary must be caught up with the stepped down
1425+
primary and have :rsconf:`~members[n].priority` greater than 0. If
1426+
multiple secondary members meet this criteria, the stepped down
1427+
primary selects the eligible secondary with the highest
1428+
:rsconf:`~members[n].priority`. If the more than one eligible
1429+
secondary members have the same :rsconf:`~members[n].priority`, the
1430+
stepped down primary selects the secondary with the lowest
1431+
:rsconf:`~members[n]._id`. The stepped down primary does not wait
1432+
for the effects of the handoff.
1433+
1434+
The parameter has no impact if the primary steps down for reasons
1435+
other than :method:`rs.stepDown()` (or the
1436+
:dbcommand:`replSetStepDown` command without the ``force: true``).
1437+
14071438
Sharding Parameters
14081439
~~~~~~~~~~~~~~~~~~~
14091440

source/reference/replica-configuration.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,11 @@ Replica Set Configuration Fields
477477
sensitivity to primary node or network slowness or spottiness.
478478

479479
The setting only applies when using :rsconf:`protocolVersion: 1`.
480-
480+
481+
.. note::
482+
483+
.. include:: /includes/extracts/rs-stepdown-election-handoff.rst
484+
481485
.. rsconf:: settings.catchUpTimeoutMillis
482486

483487
.. versionadded:: 3.4

source/tutorial/force-member-to-be-primary.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ available for a set to reconfigure a set or elect a primary. See
3737
Procedures
3838
----------
3939

40+
.. note::
41+
42+
.. include:: /includes/extracts/rs-stepdown-election-handoff.rst
43+
4044
.. _replica-set-force-member-to-be-primary-via-priority-setting:
4145

4246
Force a Member to be Primary by Setting its Priority High

0 commit comments

Comments
 (0)