Skip to content

(DOCS-11711): Updated downgrade shutdown requirement. #3335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions source/includes/note-clean-shutdown.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. note::

If you do not perform a clean shut down, errors may result that
prevent the :binary:`~bin.mongod` process from starting.

Forcibly terminating the :binary:`~bin.mongod` process may cause
inaccurate results for :method:`db.collection.count()` and
:method:`db.stats()` as well as lengthen startup time the next time
that the :binary:`~bin.mongod` process is restarted.

Invoking ``sudo service mongod stop`` does not guarantee a
clean shutdown. This ``service`` script forceably stops the
:binary:`~bin.mongod` process if it takes longer than five
minutes to shut down.
9 changes: 9 additions & 0 deletions source/includes/steps-3.6-downgrade-mongod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,13 @@ ref: 3.6-downgrade-restart-instance
content: |
Shut down your :binary:`~bin.mongod` instance. Replace the existing
binary with the downloaded :binary:`~bin.mongod` binary and restart.

a. :ref:`Perform a clean shut down <terminate-mongod-processes>`
of the :binary:`~bin.mongod` process.

.. include:: /includes/note-clean-shutdown.rst

#. Replace the |newversion| binary with the |oldversion| binary.

#. Start the |oldversion| :binary:`~bin.mongod` process.
...
19 changes: 13 additions & 6 deletions source/includes/steps-3.6-downgrade-replica-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ content: |
Downgrade each :term:`secondary` member of the replica set, one at a
time:

a. Shut down the :binary:`~bin.mongod`. See :ref:`terminate-mongod-processes` for instructions on safely terminating :binary:`~bin.mongod` processes.
a. :ref:`Perform a clean shut down <terminate-mongod-processes>`
of the :binary:`~bin.mongod` process.

#. Replace the |newversion| binary with the |oldversion| binary and restart.
.. include:: /includes/note-clean-shutdown.rst

#. Replace the |newversion| binary with the |oldversion| binary.

#. Start the |oldversion| :binary:`~bin.mongod` process.

#. Wait for the member to recover to ``SECONDARY`` state
before downgrading the next secondary. To check the member's state,
use the :method:`rs.status()` method in the :binary:`~bin.mongo` shell.
before downgrading the next secondary. To check the member's
state, use the :method:`rs.status()` method in the
:binary:`~bin.mongo` shell.

---
title: Step down the primary.
Expand All @@ -46,7 +52,8 @@ level: 4
ref: downgrade-primary
content: |
When :method:`rs.status()` shows that the primary has stepped down
and another member has assumed ``PRIMARY`` state, shut down the
and another member has assumed ``PRIMARY`` state,
:ref:`perform a clean shut down <terminate-mongod-processes>` of the
previous primary and replace the :binary:`~bin.mongod` binary with
the |oldversion| binary and start the new instance.
the |oldversion| binary and start the new process.
...
19 changes: 12 additions & 7 deletions source/includes/steps-3.6-downgrade-sharded-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ content: |

Downgrade the shards one at a time. If the shards are replica sets, for each shard:

1. Downgrade the :ref:`secondary <replica-set-secondary-members>`
a. Downgrade the :ref:`secondary <replica-set-secondary-members>`
members of the replica set one at a time:

a. Shut down the :binary:`~bin.mongod` instance and replace the |newversion|
binary with the |oldversion| binary.
i. :ref:`Perform a clean shut down <terminate-mongod-processes>`
of the :binary:`~bin.mongod` process.

.. include:: /includes/note-clean-shutdown.rst

#. Replace the |newversion| binary with the |oldversion| binary.

#. Start the |oldversion| binary with the ``--shardsvr`` and
``--port`` command line options. Include any other
Expand All @@ -42,7 +46,8 @@ content: |

.. code-block:: sh

mongod --shardsvr --port <port> --dbpath <path> --bind_ip localhost,<ip address>
mongod --shardsvr --port <port> --dbpath <path> \
--bind_ip localhost,<ip address>

Or if using a :doc:`configuration file
</reference/configuration-options>`, update the file to
Expand Down Expand Up @@ -118,10 +123,10 @@ ref: 3.6-downgrade-config-servers
content: |-
If the config servers are replica sets:

1. Downgrade the :ref:`secondary <replica-set-secondary-members>`
a. Downgrade the :ref:`secondary <replica-set-secondary-members>`
members of the replica set one at a time:

a. Shut down the secondary :binary:`~bin.mongod` instance and replace
i. Shut down the secondary :binary:`~bin.mongod` instance and replace
the |newversion| binary with the |oldversion| binary.

#. Start the |oldversion| binary with both the ``--configsvr`` and
Expand Down Expand Up @@ -160,7 +165,7 @@ content: |-

#. Step down the replica set primary.

a. Connect a :binary:`~bin.mongo` shell to the primary and use
i. Connect a :binary:`~bin.mongo` shell to the primary and use
:method:`rs.stepDown()` to step down the primary and force an
election of a new primary:

Expand Down