@@ -168,17 +168,18 @@ compact
168
168
``force:true`` above for information regarding compacting the
169
169
primary.
170
170
171
- .. warning:: If you run :dbcommand:`compact` on a secondary,
172
- the secondary will enter a ``RECOVERING`` state to prevent
173
- clients from sending read operations during compaction. Once
174
- the compaction finishes the secondary will automatically
175
- return to ``SECONDARY`` state. See :data:`~replSetGetStatus.members.state`
176
- for more information on states.
177
-
178
- Refer to the "`partial script for automating step down
179
- and compaction <https://github.com/mongodb/mongo-snippets/blob/master/js/compact-example.js> `_"
171
+ .. warning::
172
+
173
+ If you run :dbcommand:`compact` on a secondary, the secondary
174
+ will enter a ``RECOVERING`` state to prevent clients from
175
+ sending read operations during compaction. Once the operation
176
+ finishes the secondary will automatically return to
177
+ ``SECONDARY`` state. See :data:`~replSetGetStatus.members.state`
178
+ for more information replica set member states. Refer to the
179
+ "`partial script for automating step down and compaction`_"
180
180
for an example of this procedure.
181
181
182
+
182
183
- :dbcommand:`compact` is a command issued to a :program:`mongod`.
183
184
In a sharded environment, run :dbcommand:`compact` on each shard
184
185
separately as a maintenance operation.
@@ -190,3 +191,7 @@ compact
190
191
fragmentation.
191
192
192
193
.. seealso:: :dbcommand:`repairDatabase`
194
+
195
+
196
+ .. _`partial script for automating step down and compaction`:
197
+ https://github.com/mongodb/mongo-snippets/blob/master/js/compact-example.js
0 commit comments