@@ -15,17 +15,16 @@ Definition
15
15
16
16
.. dbcommand:: replSetResizeOplog
17
17
18
- .. versionadded:: 3.6
19
-
20
- Use the :dbcommand:`replSetResizeOplog` administrative command to
21
- change the size of a replica set member's oplog. [#oplog]_
22
-
23
-
24
18
.. versionadded:: 4.4
25
19
26
20
:dbcommand:`replSetResizeOplog` also supports specifying the
27
21
minimum number of hours to preserve an oplog entry.
28
22
23
+ .. versionchanged:: 5.0
24
+
25
+ To set the ``replSetOplog`` size in :binary:`~bin.mongosh`, use
26
+ the ``Double()`` constructor.
27
+
29
28
:dbcommand:`replSetResizeOplog` enables you to resize the oplog or
30
29
its minimum retention period dynamically without restarting the
31
30
:binary:`~bin.mongod` process.
@@ -72,6 +71,10 @@ Definition
72
71
73
72
- The maximum size you can specify is 1 petabytes.
74
73
74
+ - Explicitly cast the ``size`` as a double in
75
+ :binary:`~bin.mongosh` with ``Double()``. See
76
+ :ref:`oplog-ex-change-size`.
77
+
75
78
* - :ref:`minRetentionHours <replSetResizeOplog-minRetentionHours>`
76
79
77
80
- double
@@ -119,6 +122,8 @@ You can only use :dbcommand:`replSetResizeOplog` on
119
122
See the :ref:`tutorial-change-oplog-size` tutorial for a procedure
120
123
on using :dbcommand:`replSetResizeOplog` command to resize the oplog.
121
124
125
+ .. include:: /includes/fact-oplog-size.rst
126
+
122
127
Starting in MongoDB 4.0, MongoDB forbids dropping the ``local.oplog.rs``
123
128
collection. For more information on this restriction, see
124
129
:ref:`oplog-coll-behavior`.
@@ -227,6 +232,8 @@ For more information on locking in MongoDB, see :doc:`/faq/concurrency`.
227
232
Examples
228
233
--------
229
234
235
+ .. _oplog-ex-change-size:
236
+
230
237
Change the Maximum Oplog Size
231
238
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
232
239
@@ -249,7 +256,7 @@ oplog size of this member to 16384 megabytes:
249
256
250
257
.. code-block:: javascript
251
258
252
- db.adminCommand({ "replSetResizeOplog": 1, size: 16384})
259
+ db.adminCommand({ "replSetResizeOplog": 1, size: Double( 16384) })
253
260
254
261
To verify the new oplog size, rerun the :method:`db.collection.stats()` method:
255
262
@@ -269,9 +276,6 @@ The above command returns:
269
276
may cause replica members syncing with that node to become stale.
270
277
To resync those members, see :doc:`/tutorial/resync-replica-set-member`.
271
278
272
- .. [#oplog]
273
-
274
- .. include:: /includes/fact-oplog-size.rst
275
279
276
280
Change the Minimum Oplog Retention Period
277
281
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0 commit comments