diff --git a/source/includes/apiargs-method-rs.stepDown-param.yaml b/source/includes/apiargs-method-rs.stepDown-param.yaml index 5f06fb2bd49..a2f4044e0b2 100644 --- a/source/includes/apiargs-method-rs.stepDown-param.yaml +++ b/source/includes/apiargs-method-rs.stepDown-param.yaml @@ -1,13 +1,24 @@ arg_name: param -description: | - The number of seconds to step down the primary, during which time the - stepdown member is ineligible from becoming primary. If this - parameter is unspecified, the method uses the default value of 60 - seconds. +source: + file: apiargs-command-replSetStepDown-field.yaml + ref: replSetStepDown interface: method -name: seconds +name: stepDownSecs operation: rs.stepDown -optional: true position: 1 type: number +--- +arg_name: param +source: + file: apiargs-command-replSetStepDown-field.yaml + ref: secondaryCatchUpPeriodSecs +description: | + The number of seconds that ``mongod`` will wait for an + electable secondary to catch up to the primary. + + When specified, ``secondaryCatchUpPeriodSecs`` + overrides the default wait time of ``10`` seconds. +interface: method +operation: rs.stepDown +position: 2 ... diff --git a/source/reference/method/rs.stepDown.txt b/source/reference/method/rs.stepDown.txt index b9702c5990d..1dec43a8660 100644 --- a/source/reference/method/rs.stepDown.txt +++ b/source/reference/method/rs.stepDown.txt @@ -7,7 +7,7 @@ rs.stepDown() Description ----------- -.. method:: rs.stepDown(seconds) +.. method:: rs.stepDown(stepDownSecs, secondaryCatchUpPeriodSecs) Forces the :term:`primary` of the replica set to become a :term:`secondary`, triggering an :ref:`election for primary @@ -23,7 +23,7 @@ Description The method is only valid against the primary and will error if run on a non-primary member. - The :method:`rs.stepDown()` method has the following parameter: + The :method:`rs.stepDown()` method has the following parameters: .. include:: /includes/apiargs/method-rs.stepDown-param.rst @@ -40,18 +40,23 @@ terminate long running user operations that would block the primary from stepping down, such as an index build, a write operation or a map-reduce job. -To avoid rollbacks, :method:`rs.stepDown()` only steps down the primary -if an electable secondary is completely caught up with the primary. The -method will wait up to the ``10`` seconds for a secondary to catch up. +To avoid rollbacks, :method:`rs.stepDown()`, by default, only +steps down the primary if an electable secondary is completely caught up +with the primary. The command will wait up to either 10 seconds or the +``secondaryCatchUpPeriodSecs`` for a secondary to catch up. If no electable secondary meets this criterion by the waiting period, the primary does not step down and the method throws an exception. -If the :method:`rs.stepDown()` completes successfully, the method -forces all clients currently connected to the database to disconnect. -This helps ensure that the clients maintain an accurate view of the -replica set. The :program:`mongo` shell will display an error related -to the disconnect. +Upon successful stepdown, :method:`rs.stepDown()` forces all +clients currently connected to the database to disconnect. This helps +ensure that the clients maintain an accurate view of the replica set. + +Because the disconnect includes the connection used to run the command, +you cannot retrieve the return status of the command if the command +completes successfully; i.e. you can only retrieve the return status of +the command if it errors. When running the command in a script, the +script should account for this behavior. .. note::