Skip to content

Commit 4449efc

Browse files
Docsp 15767 forwardport (#3142)
* Removed self-links and 4.2 behavior * Added release note for compact support with time series collections
1 parent 2891183 commit 4449efc

File tree

2 files changed

+25
-41
lines changed

2 files changed

+25
-41
lines changed

source/reference/command/compact.txt

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Definition
1818
.. dbcommand:: compact
1919

2020
Rewrites and defragments all data and indexes in a collection. On
21-
:ref:`WiredTiger <storage-wiredtiger>` databases, this command will release
22-
unneeded disk space to the operating system.
21+
:ref:`WiredTiger <storage-wiredtiger>` databases, this command
22+
releases unneeded disk space to the operating system.
2323

2424
Syntax
2525
------
@@ -39,13 +39,6 @@ Command Fields
3939

4040
The command takes the following fields:
4141

42-
.. note:: Starting in MongoDB 4.2
43-
44-
45-
MongoDB removes the MMAPv1 storage engine and the MMAPv1 specific
46-
options ``paddingFactor``, ``paddingBytes``, ``preservePadding``
47-
for :dbcommand:`compact`.
48-
4942

5043
.. list-table::
5144
:header-rows: 1
@@ -65,16 +58,9 @@ The command takes the following fields:
6558

6659
.. _compact-force-option:
6760

68-
Optional. Starting in v4.4, if specified, forces
69-
:dbcommand:`compact` to run on the :term:`primary` in
70-
a :term:`replica set`. Before v4.4, this boolean field
71-
enabled :dbcommand:`compact` to run on the :term:`primary`
72-
in a :term:`replica set` if the value was ``true`` and
73-
returned an error when run on a :term:`primary` if the
74-
value was ``false``, because the command blocked all other
75-
operations.
76-
77-
Starting in v4.4, :dbcommand:`compact` does not block
61+
Optional. If specified, forces
62+
``compact`` to run on the :term:`primary` in
63+
a :term:`replica set`. ``compact`` does not block
7864
:ref:`crud` on the database it is compacting.
7965

8066
* - ``comment``
@@ -84,7 +70,7 @@ The command takes the following fields:
8470

8571

8672
.. warning:: Always have an up-to-date backup before performing server
87-
maintenance such as the :dbcommand:`compact` operation.
73+
maintenance such as the ``compact`` operation.
8874

8975
.. _compact-authentication:
9076

@@ -94,7 +80,7 @@ The command takes the following fields:
9480
For clusters enforcing :ref:`authentication <authentication>`,
9581
you must authenticate as a user with the :authaction:`compact` privilege
9682
action on the target collection. The :authrole:`dbAdmin` role provides
97-
the required privileges for running :dbcommand:`compact` against
83+
the required privileges for running ``compact`` against
9884
non-system collections.
9985

10086
For more information on configuring the ``resource`` document, see
@@ -140,9 +126,6 @@ Blocking behavior is version specific.
140126
* - Version
141127
- Blocking Behavior
142128

143-
* - Pre 4.4
144-
- ``compact`` blocks all read and write activity.
145-
146129
* - 4.4
147130
- - .. include:: /includes/reference/compact-methods-list.rst
148131
- All other operations are permitted.
@@ -167,14 +150,14 @@ Operation Termination
167150

168151
If you terminate the operation with the :method:`db.killOp()
169152
<db.killOp()>` method or restart the server before the
170-
:dbcommand:`compact` operation has finished, be aware of the following:
153+
``compact`` operation has finished, be aware of the following:
171154

172155
- If you have journaling enabled, the data remains valid and
173-
usable, regardless of the state of the :dbcommand:`compact` operation.
156+
usable, regardless of the state of the ``compact`` operation.
174157
You may have to manually rebuild the indexes.
175158

176159
- If you do not have journaling enabled and the :binary:`~bin.mongod` or
177-
:dbcommand:`compact` terminates during the operation, it is impossible
160+
``compact`` terminates during the operation, it is impossible
178161
to guarantee that the data is in a valid state.
179162

180163
- In either case, much of the existing free space in the collection may
@@ -187,14 +170,14 @@ Disk Space
187170
To see how the storage space changes for the collection, run the
188171
:dbcommand:`collStats` command before and after compaction.
189172

190-
On :ref:`WiredTiger <storage-wiredtiger>`, :dbcommand:`compact` attempts
173+
On :ref:`WiredTiger <storage-wiredtiger>`, ``compact`` attempts
191174
to reduce the required storage space for data and indexes in a
192175
collection, releasing unneeded disk space to the operating system. The
193176
effectiveness of this operation is workload dependent and no disk space
194177
may be recovered. This command is useful if you have removed a large
195178
amount of data from the collection, and do not plan to replace it.
196179

197-
:dbcommand:`compact` may require additional disk space to run on
180+
``compact`` may require additional disk space to run on
198181
WiredTiger databases.
199182

200183
.. _compact-cmd-replica-sets:
@@ -250,11 +233,6 @@ Blocking behavior on secondary nodes is version specific.
250233
* - Version
251234
- Blocking Behavior
252235

253-
* - Pre 4.4
254-
- - ``compact`` blocks all read and write activity.
255-
- No replication possible.
256-
- Secondary node is in :replstate:`RECOVERING` state.
257-
258236
* - 4.4
259237
- - ``compact`` blocks all write activity.
260238
- No replication possible.
@@ -277,20 +255,20 @@ For replica set maintenance and availability, see
277255
Sharded Clusters
278256
~~~~~~~~~~~~~~~~
279257

280-
:dbcommand:`compact` only applies to :binary:`~bin.mongod` instances. In a
281-
sharded environment, run :dbcommand:`compact` on each shard separately
258+
``compact`` only applies to :binary:`~bin.mongod` instances. In a
259+
sharded environment, run ``compact`` on each shard separately
282260
as a maintenance operation.
283261

284-
You cannot issue :dbcommand:`compact` against a :binary:`~bin.mongos` instance.
262+
You cannot issue ``compact`` against a :binary:`~bin.mongos` instance.
285263

286264
Capped Collections
287265
~~~~~~~~~~~~~~~~~~
288266

289-
On :ref:`WiredTiger <storage-wiredtiger>`, the :dbcommand:`compact`
267+
On :ref:`WiredTiger <storage-wiredtiger>`, the ``compact``
290268
command will attempt to compact the collection.
291269

292270
Index Building
293271
~~~~~~~~~~~~~~
294272

295273
:binary:`~bin.mongod` rebuilds all indexes in parallel following the
296-
:dbcommand:`compact` operation.
274+
``compact`` operation.

source/release-notes/6.3.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ Starting in MongoDB 6.3, these server parameters were added:
137137
- :parameter:`chunkMigrationConcurrency` sets the number of threads on
138138
the source shard and the receiving shard for migrating chunks.
139139

140-
Time Series Collection Parameters
141-
---------------------------------
140+
Time Series Collection Custom Bucketing Parameters
141+
--------------------------------------------------
142142

143143
MongoDB 6.3 adds the following :ref:`time series parameters
144144
<time-series-fields>`:
@@ -148,6 +148,12 @@ MongoDB 6.3 adds the following :ref:`time series parameters
148148
- ``bucketRoundingSeconds`` sets the time interval that determines the
149149
starting timestamp for a new bucket.
150150

151+
``compact`` Support for Time Series Collections
152+
-----------------------------------------------
153+
154+
Starting in MongoDB 6.3, the :dbcommand:`compact` command works with
155+
:ref:`time series collections <manual-timeseries-landing>`.
156+
151157
Report an Issue
152158
---------------
153159

0 commit comments

Comments
 (0)