Skip to content

Commit 65407cb

Browse files
mungitoperritojeff-allen-mongo
authored andcommitted
DOCS-14790 update type for replSetResizeOplog size param
1 parent 7325048 commit 65407cb

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

source/reference/command/replSetResizeOplog.txt

+14-10
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,16 @@ Definition
1515

1616
.. dbcommand:: replSetResizeOplog
1717

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-
2418
.. versionadded:: 4.4
2519

2620
:dbcommand:`replSetResizeOplog` also supports specifying the
2721
minimum number of hours to preserve an oplog entry.
2822

23+
.. versionchanged:: 5.0
24+
25+
To set the ``replSetOplog`` size in :binary:`~bin.mongosh`, use
26+
the ``Double()`` constructor.
27+
2928
:dbcommand:`replSetResizeOplog` enables you to resize the oplog or
3029
its minimum retention period dynamically without restarting the
3130
:binary:`~bin.mongod` process.
@@ -72,6 +71,10 @@ Definition
7271

7372
- The maximum size you can specify is 1 petabytes.
7473

74+
- Explicitly cast the ``size`` as a double in
75+
:binary:`~bin.mongosh` with ``Double()``. See
76+
:ref:`oplog-ex-change-size`.
77+
7578
* - :ref:`minRetentionHours <replSetResizeOplog-minRetentionHours>`
7679

7780
- double
@@ -119,6 +122,8 @@ You can only use :dbcommand:`replSetResizeOplog` on
119122
See the :ref:`tutorial-change-oplog-size` tutorial for a procedure
120123
on using :dbcommand:`replSetResizeOplog` command to resize the oplog.
121124

125+
.. include:: /includes/fact-oplog-size.rst
126+
122127
Starting in MongoDB 4.0, MongoDB forbids dropping the ``local.oplog.rs``
123128
collection. For more information on this restriction, see
124129
:ref:`oplog-coll-behavior`.
@@ -227,6 +232,8 @@ For more information on locking in MongoDB, see :doc:`/faq/concurrency`.
227232
Examples
228233
--------
229234

235+
.. _oplog-ex-change-size:
236+
230237
Change the Maximum Oplog Size
231238
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
232239

@@ -249,7 +256,7 @@ oplog size of this member to 16384 megabytes:
249256

250257
.. code-block:: javascript
251258

252-
db.adminCommand({ "replSetResizeOplog": 1, size: 16384})
259+
db.adminCommand({ "replSetResizeOplog": 1, size: Double(16384)})
253260

254261
To verify the new oplog size, rerun the :method:`db.collection.stats()` method:
255262

@@ -269,9 +276,6 @@ The above command returns:
269276
may cause replica members syncing with that node to become stale.
270277
To resync those members, see :doc:`/tutorial/resync-replica-set-member`.
271278

272-
.. [#oplog]
273-
274-
.. include:: /includes/fact-oplog-size.rst
275279

276280
Change the Minimum Oplog Retention Period
277281
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

source/release-notes/5.0-compatibility.txt

+3
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,9 @@ Starting in MongoDB 5.0:
382382
default write concern. To set the global default write concern, use
383383
the :dbcommand:`setDefaultRWConcern` command.
384384

385+
- To set the ``replSetOplog`` size in :binary:`~bin.mongosh`, use the
386+
``Double()`` constructor with the :dbcommand:`replSetResizeOplog`
387+
command.
385388

386389
Deprecations
387390
~~~~~~~~~~~~

source/tutorial/change-oplog-size.txt

+5-4
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,17 @@ The ``maxSize`` field displays the collection size in bytes.
6969
C. Change the oplog size of the replica set member
7070
--------------------------------------------------
7171

72-
To resize the oplog, run the :dbcommand:`replSetResizeOplog` command,
73-
passing the desired size in megabytes as the ``size`` parameter. The
74-
specified size must be greater than ``990``, or 990 megabytes.
72+
Resize the oplog with the :dbcommand:`replSetResizeOplog` command. The
73+
``size`` is a double and must be greater than ``990`` megabytes. To
74+
explicitly cast the oplog ``size`` in :binary:`~bin.mongosh`, use the
75+
``Double()`` constructor.
7576

7677
The following operation changes the oplog size of the replica set
7778
member to 16 gigabytes, or 16000 megabytes.
7879

7980
.. code-block:: javascript
8081

81-
db.adminCommand({replSetResizeOplog: 1, size: 16000})
82+
db.adminCommand({replSetResizeOplog: 1, size: Double(16000)})
8283

8384
.. [#oplog]
8485

0 commit comments

Comments
 (0)