Skip to content
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

DOCSP-38679 mongoexport consistency consideration #166

Merged
merged 6 commits into from
Jul 22, 2024
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
12 changes: 12 additions & 0 deletions source/mongodump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,18 @@ Syntax
.. tab:: Connect to a Sharded Cluster
:tabid: connect-to-a-sharded-cluster

.. note::

To avoid data inconsistencies, pause the following actions on your
sharded cluster when you run ``mongodump``:

- Cross-shard transactions
- Data definition language operations (operations that create and modify
collections)
- Chunk balancing

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we instead advise users to pause all writes and turn off balancers? Certain operations may use transactions implicitly under the hood. There could also be race conditions between turning off writes and finishing any in-flight operations, so users should make certain that the cluster has fully quiesced before attempting any snapshots. Ditto this comment for mongoexport as well

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ltran-mdb2 just wanted to follow-up on this. Let me know if this needs a separate ticket - thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mvankeulen94 , sorry for the delay! Could you create a separate ticket for this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed https://jira.mongodb.org/browse/DOCSP-41895, thank you! Please feel free to reassign if needed

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally rather than having this blurb here, we could instead restate the disclaimer that these tools are not intended for taking backups, and to see https://www.mongodb.com/docs/manual/administration/backup-sharded-clusters/ for how to back up sharded clusters.


To stop the balancer, use the :method:`sh.stopBalancer()` method.

To connect to a sharded cluster to export its data, you can:

- Specify the hostname of the ``mongos`` instance in the
Expand Down
15 changes: 15 additions & 0 deletions source/mongoexport.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ or CSV export of data stored in a MongoDB instance.
Run ``mongoexport`` from the system command line, not the
:binary:`~bin.mongo` shell.

``mongoexport`` is not a tool for backing up deployments. If you want to
create a backup solution, see :ref:`manual-tutorial-backup-and-restore`.

.. seealso::

:binary:`~bin.mongoimport` which provides the corresponding
Expand Down Expand Up @@ -171,6 +174,18 @@ For more information on the options available, see :ref:`mongoexport-options`.
Connect to a Sharded Cluster
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. note::

To avoid data inconsistencies, pause the following actions on your
sharded cluster when you run ``mongoexport``:

- Cross-shard transactions
- Data definition language operations (operations that create and modify
collections)
- Chunk balancing

To stop the balancer, use the :method:`sh.stopBalancer()` method.

To connect to a sharded cluster to export its data, you can either:

- Specify the hostname of the :binary:`~bin.mongos` instance in the
Expand Down