Skip to content

Commit b7a5fe2

Browse files
author
Sam Kleinman
committed
DOCS-814 notes for porting durability and repair.
1 parent 214a30b commit b7a5fe2

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

source/reference/method/db.collection.validate.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ db.collection.validate()
2626
intensive, and may impact the performance of your MongoDB
2727
instance.
2828

29-
.. seealso:: ":doc:`/reference/collection-validation`"
29+
.. seealso:: :doc:`/reference/collection-validation`

source/tutorial/recover-data-following-unexpected-shutdown.txt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Recover MongoDB Data following Unexpected Shutdown
66

77
If MongoDB does not shutdown cleanly [#clean-shutdown]_ the on-disk
88
representation of the data files will likely reflect an inconsistent
9-
state which could lead to data corruption.
9+
state which could lead to data corruption. [#validation]_
1010

1111
To prevent data inconsistency and corruption, always shut down the
1212
database cleanly and use the :ref:`durability journaling
@@ -23,7 +23,7 @@ the :program:`mongod` instance with an empty :setting:`dbpath` and
2323
allow MongoDB to resync the data.
2424

2525
.. seealso:: The :doc:`/administration` documents, including
26-
:ref:`replica-set-syncing`, and the
26+
:ref:`Replica Set Syncing <replica-set-syncing>`, and the
2727
documentation on the :setting:`repair`, :setting:`repairpath`, and
2828
:setting:`journal` settings.
2929

@@ -32,6 +32,13 @@ allow MongoDB to resync the data.
3232
"Control-C" (when running :program:`mongod` in interactive mode,)
3333
or ``kill $(pidof mongod)`` or ``kill -2 $(pidof mongod)``.
3434

35+
.. [#validation] You can also use the :method:`db.collection.validate()`
36+
method to test the integrity of a single collection. However, this
37+
process is time consuming, and without journaling you can safely
38+
assume that the data is in an invalid state and you should either
39+
run the repair operation or resync from an intact member of the
40+
replica set.
41+
3542
Process
3643
-------
3744

@@ -72,7 +79,7 @@ Overview
7279
.. warning:: Recovering a member of a replica set.
7380

7481
Do not use this procedure to recover a member of a :term:`replica set`.
75-
Instead you should either restore from a :doc:`backup </administration/backups>`
82+
Instead you should either restore from a :doc:`backup </administration/backups>`
7683
or resync from an intact member of the set, as described in :ref:`replica-set-resync-stale-member`.
7784

7885
There are two processes to repair data files that result from an
@@ -95,6 +102,12 @@ unexpected shutdown:
95102
You must remove the ``mongod.lock`` file before using this
96103
procedure.
97104

105+
.. note::
106+
107+
:option:`--repair <mongod --repair>` functionality is also
108+
available in the shell with the :method:`db.repairDatabase()`
109+
helper for the :dbcommand:`repairDatabase` command.
110+
98111
Procedures
99112
~~~~~~~~~~
100113

0 commit comments

Comments
 (0)