Skip to content

Commit 39d4b71

Browse files
authored
* DOCSP-33284 Fix Compact Behavior Notes * * * * * * * * * * * * * * * *
1 parent dbd7d1a commit 39d4b71

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

source/reference/command/compact.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ replica set, however there are some important considerations:
207207

208208
- The primary node does not replicate the ``compact`` command to the
209209
secondaries.
210-
- The ``compact`` command blocks writes while it runs.
211210
- You should run ``compact`` on secondary nodes whenever possible. If
212211
you cannot run ``compact`` on secondaries, see the :ref:`force
213212
<compact-force-option>` option.
@@ -256,17 +255,21 @@ Blocking behavior on secondary nodes is version specific.
256255
- Secondary node is in :replstate:`RECOVERING` state.
257256

258257
* - 4.4
259-
- - ``compact`` blocks all write activity.
260-
- No replication possible.
261-
- Reads not permitted.
258+
- - No replication is possible.
259+
- Reads are not permitted.
262260

263-
* - Post 4.4.17, 5.0.12, 6.0.2
264-
- - ``compact`` blocks all write activity.
265-
- A secondary node can replicate while ``compact`` is running.
261+
* - Post 4.4.17, 5.0.12, and 6.0.2
262+
- - A secondary node can replicate while ``compact`` is running.
266263
- Reads permitted.
267264

268-
When ``compact`` completes, the secondary returns to the
269-
:replstate:`SECONDARY` state.
265+
Replication status while the ``compact`` command is running depends on
266+
your specific MongoDB version:
267+
268+
- In MongoDB versions ``4.4.9`` and later, the replica set remains in a
269+
:replstate:`SECONDARY` status.
270+
271+
- In MongoDB versions earlier than ``4.4.9``, ``compact`` forces
272+
the replica set into the :replstate:`RECOVERING` status.
270273

271274
For more information about replica set member states, see
272275
See :ref:`replica-set-member-states`.

0 commit comments

Comments
 (0)