Skip to content

DOCS-1603, DOCS-3404 #1926

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

Closed
wants to merge 1 commit into from
Closed
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
42 changes: 26 additions & 16 deletions source/reference/command/fsync.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ block. As a result, :dbcommand:`fsync`,
with lock, is not a reliable mechanism for making
a :program:`mongod` instance operate in a read-only mode.

.. important::

Blocked read operations prevent verification of authentication.
Such reads are necessary to establish new connections
to a :program:`mongod` that enforces authorization checks.

.. warning::

When calling :dbcommand:`fsync` with lock, ensure that the connection remains
open to allow a subsequent call to :method:`db.fsyncUnlock()`.

Closing the connection may make it difficult to release the lock.


=======
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like a merge artifact.

Examples
--------

Expand Down Expand Up @@ -84,6 +99,16 @@ You may continue to perform read operations on a :program:`mongod` instance that
:dbcommand:`fsync` lock. However, after the first write operation all
subsequent read operations wait until you unlock the :program:`mongod` instance.

Unlock ``mongod`` Instance
~~~~~~~~~~~~~~~~~~~~~~~~~~

To unlock the :program:`mongod`, use :method:`db.fsyncUnlock()`:

.. code-block:: javascript

db.fsyncUnlock();


Check Lock Status
~~~~~~~~~~~~~~~~~

Expand All @@ -109,19 +134,4 @@ call it, with the following syntax:
serverIsLocked()

This function will return ``true`` if the :program:`mongod` instance is
currently locked and ``false`` if the :program:`mongod` is not locked. To
unlock the :program:`mongod`, make a request for an unlock using the
following operation:

.. code-block:: javascript

db.getSiblingDB("admin").$cmd.sys.unlock.findOne();

Unlock ``mongod`` Instance
~~~~~~~~~~~~~~~~~~~~~~~~~~

To unlock the :program:`mongod` instance, use :method:`db.fsyncUnlock()`:

.. code-block:: javascript

db.fsyncUnlock();
currently locked and ``false`` if the :program:`mongod` is not locked.
15 changes: 15 additions & 0 deletions source/reference/method/db.fsyncLock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,18 @@ db.fsyncLock()

This function locks the database and create a window for
:doc:`backup operations </core/backups>`.

.. important::

:method:`db.fsyncLock()` *may* block reads, including those necessary to
verify authentication.
Such reads are necessary to establish new connections to a
:program:`mongod` that enforces authorization checks.

.. warning::

When calling :method:`db.fsyncLock()`, ensure that the connection
is kept open to allow a subsequent call to :method:`db.fsyncUnlock()`.

Closing the connection may make it difficult to release the
lock.