Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCS-14790 update type for replSetResizeOplog size param #5828

Merged
merged 1 commit into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions source/reference/command/replSetResizeOplog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@ Definition

.. dbcommand:: replSetResizeOplog

.. versionadded:: 3.6

Use the :dbcommand:`replSetResizeOplog` administrative command to
change the size of a replica set member's oplog. [#oplog]_


.. versionadded:: 4.4

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

.. versionchanged:: 5.0

To set the ``replSetOplog`` size in :binary:`~bin.mongosh`, use
the ``Double()`` constructor.

:dbcommand:`replSetResizeOplog` enables you to resize the oplog or
its minimum retention period dynamically without restarting the
:binary:`~bin.mongod` process.
Expand Down Expand Up @@ -72,6 +71,10 @@ Definition

- The maximum size you can specify is 1 petabytes.

- Explicitly cast the ``size`` as a double in
:binary:`~bin.mongosh` with ``Double()``. See
:ref:`oplog-ex-change-size`.

* - :ref:`minRetentionHours <replSetResizeOplog-minRetentionHours>`

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

.. include:: /includes/fact-oplog-size.rst

Starting in MongoDB 4.0, MongoDB forbids dropping the ``local.oplog.rs``
collection. For more information on this restriction, see
:ref:`oplog-coll-behavior`.
Expand Down Expand Up @@ -227,6 +232,8 @@ For more information on locking in MongoDB, see :doc:`/faq/concurrency`.
Examples
--------

.. _oplog-ex-change-size:

Change the Maximum Oplog Size
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

.. code-block:: javascript

db.adminCommand({ "replSetResizeOplog": 1, size: 16384})
db.adminCommand({ "replSetResizeOplog": 1, size: Double(16384)})

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

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

.. [#oplog]

.. include:: /includes/fact-oplog-size.rst

Change the Minimum Oplog Retention Period
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
3 changes: 3 additions & 0 deletions source/release-notes/5.0-compatibility.txt
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ Starting in MongoDB 5.0:
default write concern. To set the global default write concern, use
the :dbcommand:`setDefaultRWConcern` command.

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

Deprecations
~~~~~~~~~~~~
Expand Down
9 changes: 5 additions & 4 deletions source/tutorial/change-oplog-size.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,17 @@ The ``maxSize`` field displays the collection size in bytes.
C. Change the oplog size of the replica set member
--------------------------------------------------

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

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

.. code-block:: javascript

db.adminCommand({replSetResizeOplog: 1, size: 16000})
db.adminCommand({replSetResizeOplog: 1, size: Double(16000)})

.. [#oplog]

Expand Down