Skip to content

Commit 74ccb3d

Browse files
authored
* DOCSP-33284 Fix Compact Behavior Notes * * * * * * * * * * * * * *
1 parent 573e83f commit 74ccb3d

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

source/reference/command/compact.txt

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ replica set, however there are some important considerations:
197197

198198
- The primary node does not replicate the ``compact`` command to the
199199
secondaries.
200-
- The ``compact`` command blocks writes while it runs.
201200
- You should run ``compact`` on secondary nodes whenever possible. If
202201
you cannot run ``compact`` on secondaries, see the :ref:`force
203202
<compact-force-option>` option.
@@ -246,17 +245,21 @@ Blocking behavior on secondary nodes is version specific.
246245
- Secondary node is in :replstate:`RECOVERING` state.
247246

248247
* - 4.4
249-
- - ``compact`` blocks all write activity.
250-
- No replication possible.
251-
- Reads not permitted.
248+
- - No replication is possible.
249+
- Reads are not permitted.
252250

253251
* - Post 4.4.17 and 5.0.12
254-
- - ``compact`` blocks all write activity.
255-
- A secondary node can replicate while ``compact`` is running.
252+
- - A secondary node can replicate while ``compact`` is running.
256253
- Reads permitted.
257254

258-
When ``compact`` completes, the secondary returns to the
259-
:replstate:`SECONDARY` state.
255+
Replication status while the ``compact`` command is running depends on
256+
your specific MongoDB version:
257+
258+
- In MongoDB versions ``4.4.9`` and later, the replica set remains in a
259+
:replstate:`SECONDARY` status.
260+
261+
- In MongoDB versions earlier than ``4.4.9``, ``compact`` forces
262+
the replica set into the :replstate:`RECOVERING` status.
260263

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

0 commit comments

Comments
 (0)