Skip to content

DOCS-10808 fix oplog resize instructions on mmap #3091

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

Merged
merged 1 commit into from
Nov 9, 2017
Merged
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
20 changes: 13 additions & 7 deletions source/tutorial/change-oplog-size.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ members of your replica set. For example, to shut down, use the

.. code-block:: sh

use admin
db.shutdownServer()

Restart this :program:`mongod` as a standalone instance
Expand Down Expand Up @@ -110,15 +111,20 @@ collection:

db.temp.drop()

Use the :method:`db.collection.save()` method and a sort on
reverse :term:`natural order` to find the last entry and save it
to a temporary collection:
Retrieve the latest oplog entry by sorting on reverse :term:`natural order`.
Modify the entry to set ``op`` to "n" (representing a no-op) and clear the
``o`` and ``o2`` fields. Then insert the modified oplog entry into a temporary
collection.

.. _last-oplog-entry:

.. code-block:: javascript

db.temp.save( db.oplog.rs.find( { }, { ts: 1, h: 1 } ).sort( {$natural : -1} ).limit(1).next() )
var oplogEntry = db.oplog.rs.find().sort({$natural: -1}).limit(1).next();
oplogEntry.op = 'n'; // Change the entry to a no-op.
oplogEntry.o = {}; // Remove any update modifiers that would prevent saving the oplog entry to a normal collection.
oplogEntry.o2 = {};
db.temp.insert(oplogEntry);

To see this oplog entry, use the following operation:

Expand Down Expand Up @@ -159,12 +165,12 @@ Upon success, this command returns the following status:
Insert the Last Entry of the Old Oplog into the New Oplog
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Insert the previously saved last entry from the old oplog into the
new oplog. For example:
Insert the previously inserted latest entry from the old oplog into the new
oplog. For example:

.. code-block:: javascript

db.oplog.rs.save( db.temp.findOne() )
db.oplog.rs.insert( db.temp.findOne() )

To confirm the entry is in the new oplog, use the following operation:

Expand Down