Skip to content

Commit b56ece7

Browse files
committed
consolidate rs stepdown include files
1 parent 9a052ea commit b56ece7

File tree

5 files changed

+89
-57
lines changed

5 files changed

+89
-57
lines changed

source/includes/extracts-rs-stepdown.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,55 @@ content: |
1212
election. The stepped down primary does not wait for the effects
1313
of the handoff. For more information, see
1414
:parameter:`enableElectionHandoff`.
15+
---
16+
ref: rs-stepdown-write-fail
17+
content: |
18+
.. note::
19+
20+
All writes to the primary fail during the period starting when the
21+
|command-method-name| |command-method| is received until either a new
22+
primary is elected, or if there are no electable secondaries, the
23+
original primary resumes normal operation. The time period where
24+
writes fail is at maximum:
25+
26+
``secondaryCatchUpPeriodSecs`` (10s by default) +
27+
:rsconf:`~settings.electionTimeoutMillis` (10s by default).
28+
---
29+
ref: rs-stepdown-concurrent-ops
30+
content: |
31+
32+
The |command-method-name| |command-method| attempts to
33+
terminate long running user operations that block the primary
34+
from stepping down, such as an index build, a write operation or a
35+
map-reduce job.
36+
---
37+
ref: rs-stepdown-eligible-secondaries
38+
content: |
39+
The |command-method| then initiates a catchup period where it waits up to
40+
``secondaryCatchUpPeriodSeconds``, by default 10 seconds, for a
41+
secondary to become up-to-date with the primary. The primary only steps
42+
down if a secondary is up-to-date with the primary during the
43+
catchup period to prevent :doc:`rollbacks </core/replica-set-rollbacks>`.
44+
45+
If no electable secondary meets this criterion by the end of the waiting
46+
period, the primary does not step down and the |command-method| errors.
47+
|force-option|
48+
49+
Once the primary steps down successfully, that node cannot become the
50+
primary for the remainder of the |stepdown-secs| period,
51+
which began when the node received the |command-method|.
52+
---
53+
ref: rs-stepdown-client-connections
54+
content: |
55+
The |command-method-name| |command-method| forces all clients currently
56+
connected to the database to disconnect. This helps ensure that the
57+
clients maintain an accurate view of the replica set.
58+
59+
Because the disconnect includes the connection used to run the
60+
|command-method|, you cannot retrieve the return status of the
61+
|command-method| if the |command-method| completes successfully. You can
62+
only retrieve the return status of the |command-method| if it errors.
63+
When running the |command-method| in a script, the script should account
64+
for this behavior.
65+
1566
...

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

Lines changed: 0 additions & 10 deletions
This file was deleted.

source/includes/stepdown-behavior.rst

Lines changed: 0 additions & 40 deletions
This file was deleted.

source/reference/command/replSetStepDown.txt

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,28 @@ Behavior
4545

4646
.. |command-method-name| replace:: :dbcommand:`replSetStepDown`
4747

48-
.. include:: /includes/stepdown-behavior.rst
48+
Concurrent Operations
49+
~~~~~~~~~~~~~~~~~~~~~
50+
51+
.. include:: /includes/extracts/rs-stepdown-concurrent-ops.rst
52+
53+
Availability of Eligible Secondaries
54+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55+
56+
.. include:: /includes/extracts/rs-stepdown-eligible-secondaries.rst
57+
58+
59+
60+
Client Connections
61+
~~~~~~~~~~~~~~~~~~
62+
63+
.. include:: /includes/extracts/rs-stepdown-client-connections.rst
64+
4965

5066
Writes During Stepdown
5167
~~~~~~~~~~~~~~~~~~~~~~
5268

53-
.. include:: /includes/fact-stepdown-write-fail.rst
69+
.. include:: /includes/extracts/rs-stepdown-write-fail.rst
5470

5571
Election Handoff
5672
~~~~~~~~~~~~~~~~
@@ -70,7 +86,7 @@ The operation waits up to the default ``10`` seconds for a
7086
secondary to catch up. If no suitable secondary exists, the primary
7187
does not step down and the command errors.
7288

73-
.. include:: /includes/fact-stepdown-write-fail.rst
89+
.. include:: /includes/extracts/rs-stepdown-write-fail.rst
7490

7591
.. class:: copyable-code
7692
.. code-block:: javascript
@@ -85,7 +101,7 @@ down the member for ``120`` seconds, waiting up to ``15`` seconds for
85101
an electable secondary to catch up. If no suitable secondary exists,
86102
the primary does not step down and the command errors.
87103

88-
.. include:: /includes/fact-stepdown-write-fail.rst
104+
.. include:: /includes/extracts/rs-stepdown-write-fail.rst
89105

90106
.. class:: copyable-code
91107
.. code-block:: javascript
@@ -100,7 +116,7 @@ down the member for ``120`` seconds, waiting up to ``15`` seconds for
100116
an electable secondary to catch up. Because of the ``force: true``
101117
option, the primary steps down even if no suitable secondary exists.
102118

103-
.. include:: /includes/fact-stepdown-write-fail.rst
119+
.. include:: /includes/extracts/rs-stepdown-write-fail.rst
104120

105121
.. class:: copyable-code
106122
.. code-block:: javascript

source/reference/method/rs.stepDown.txt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,27 @@ Behavior
3737

3838
.. |command-method-name| replace:: :method:`rs.stepDown()`
3939

40-
.. include:: /includes/stepdown-behavior.rst
40+
41+
Concurrent Operations
42+
~~~~~~~~~~~~~~~~~~~~~
43+
44+
.. include:: /includes/extracts/rs-stepdown-concurrent-ops.rst
45+
46+
Availability of Eligible Secondaries
47+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48+
49+
.. include:: /includes/extracts/rs-stepdown-eligible-secondaries.rst
50+
51+
52+
Client Connections
53+
~~~~~~~~~~~~~~~~~~
54+
55+
.. include:: /includes/extracts/rs-stepdown-client-connections.rst
4156

4257
Writes During Stepdown
4358
~~~~~~~~~~~~~~~~~~~~~~
4459

45-
.. include:: /includes/fact-stepdown-write-fail.rst
60+
.. include:: /includes/extracts/rs-stepdown-write-fail.rst
4661

4762
Election Handoff
4863
~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)