@@ -10,14 +10,16 @@ db.shutdownServer()
1010 :depth: 1
1111 :class: singlecol
1212
13+ .. versionchanged:: 5.0
14+
1315.. method:: db.shutdownServer()
1416
1517 Shuts down the current :binary:`~bin.mongod` or :binary:`~bin.mongos`
1618 process cleanly and safely. You must issue the
1719 :method:`db.shutdownServer()` operation against the
1820 :term:`admin database`.
1921
20- :method:`db.shutdownServer()` has the following syntax:
22+ :method:`db.shutdownServer()` has this syntax:
2123
2224 .. code-block:: javascript
2325
@@ -26,7 +28,7 @@ db.shutdownServer()
2628 timeoutSecs: <int>
2729 })
2830
29- The method takes the following optional field :
31+ The method takes these fields :
3032
3133 .. list-table::
3234 :header-rows: 1
@@ -40,19 +42,30 @@ db.shutdownServer()
4042 - .. _shutdownServer-method-force:
4143
4244 Optional. Specify ``true`` to force the :binary:`~bin.mongod`
43- to shut down. Force shutdown interrupts any ongoing
44- operations on the :binary:`~bin.mongod` and may result in
45- unexpected behavior.
45+ or :binary:`~bin.mongos` to shut down. Force shutdown
46+ interrupts any ongoing operations on the :binary:`~bin.mongod`
47+ or :binary:`~bin.mongos` and may result in unexpected
48+ behavior.
4649
4750 * - :ref:`timeoutSecs <shutdownServer-method-timeoutSecs>`
4851
4952 - .. _shutdownServer-method-timeoutSecs:
5053
51- Optional. The number of seconds the :term:`primary` should
52- wait for a secondary to catch up. Defaults to ``10``.
54+ Optional.
55+
56+ .. _shutdownServer-method-quiesce-period:
57+
58+ .. |force| replace:: :ref:`force <shutdownServer-method-force>`
59+ .. |timeout| replace:: :ref:`timeoutSecs <shutdownServer-method-timeoutSecs>`
5360
54- If no secondaries catch up within the specified time, the
55- command fails.
61+ .. include:: /includes/quiesce-period.rst
62+
63+ In MongoDB 4.4 and earlier, for a :binary:`~bin.mongod`
64+ :term:`primary`, :ref:`timeoutSecs
65+ <shutdownServer-method-timeoutSecs>` is the number of seconds
66+ the :term:`primary` should wait for a secondary to catch up.
67+ If no secondaries catch up within the specified time, the
68+ command fails. Defaults to ``10`` seconds.
5669
5770This operation provides a wrapper around the :dbcommand:`shutdown`
5871command.
@@ -81,23 +94,25 @@ set member is running certain operations such as :ref:`index builds
8194<shutdownServer-method-force>` to force the member to interrupt those
8295operations and shut down.
8396
84- Shutting Down the Replica Set Primary
85- `````````````````````````````````````
97+ Shutting Down the Replica Set Primary, Secondary, or ``mongos``
98+ ```````````````````````````````````````````````````````````````
99+
100+ .. include:: /includes/quiesce-period.rst
86101
87- If running :method:`db.shutdownServer()` against the replica set
88- :term:`primary`, the operation implicitly uses
102+ In MongoDB 4.4 and earlier, if running :method:`db.shutdownServer()`
103+ against the replica set :term:`primary`, the operation implicitly uses
89104:dbcommand:`replSetStepDown` to step down the primary before shutting
90105down the :binary:`~bin.mongod`. If no secondary in the replica set can
91106catch up to the primary within ``10`` seconds, the shutdown operation
92- fails. You can issue :method:`~ db.shutdownServer()` with
93- :ref:`force: true <shutdownServer-method-force>` to shut down the
94- primary *even if* the step down fails.
107+ fails. You can issue :method:`db.shutdownServer()` with :ref:`force:
108+ true <shutdownServer-method-force>` to shut down the primary *even if*
109+ the step down fails.
95110
96111.. warning::
97112
98113 Force shutdown of the primary can result in the
99114 :ref:`rollback <replica-set-rollback>` of any writes not
100- yet replicated to a secondary.
115+ yet replicated to a secondary.
101116
102117.. _method-shutdown-access-control:
103118
0 commit comments