Skip to content

Updates to movePrimary command page #1736

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

Closed
wants to merge 3 commits into from
Closed
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
10 changes: 9 additions & 1 deletion source/reference/command/movePrimary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ movePrimary

.. important:: Only use :dbcommand:`movePrimary` when:

- the database does not contain any collections with data, *or*
- the database does not contain any collections, *or*

- you have drained all sharded collections using the
:dbcommand:`removeShard` command.
Expand All @@ -35,3 +35,11 @@ movePrimary
When the command returns, the database's primary location will
shift to the designated :term:`shard`. To fully decommission a
shard, use the :dbcommand:`removeShard` command.

If the :dbcommand:`movePrimary` command moves any un-sharded collections
in the process, all :program:`mongos` instances need to be restarted
or the :dbcommand:`flushRouterConfig` command needs to be invoked on all
:program:`mongos` instances before writing any data, to notify them of the
primary shard change. If this process is not followed, data may end up being
written to the incorrect shard and appears to be missing without manual
efforts to correct this.