Skip to content

DOCS-11977,DOCSP-3353: 4.0.3 disable majority read concern for PSA a… #3426

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 2 commits into from
Oct 9, 2018
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
5 changes: 5 additions & 0 deletions source/changeStreams.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ You can open change streams against:

.. _open-change-stream:

.. important::

Change stream is only available if :readconcern:`"majority"` read
concern support is enabled (default).

Open A Change Stream
--------------------

Expand Down
17 changes: 15 additions & 2 deletions source/core/transactions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -280,17 +280,20 @@ Read Concern

Multi-document transactions support read concern
:readconcern:`"snapshot"`, :readconcern:`"local"`, and
:readconcern:`"majority"`:
:readconcern:`"majority"` :

- For :readconcern:`"local"` and :readconcern:`"majority"` read
concern, MongoDB may sometimes substitute a stronger read concern.
Specifically, in MongoDB 4.0, all multi-documents transactions have
"snapshot" isolation. For details, see :ref:`readconcern-local-txn`
and :ref:`readconcern-majority-txn`.

- For :readconcern:`"majority"` read concern, if the transaction
commits with :ref:`write concern "majority"
<transactions-write-concern>`, transaction operations are guaranteed
to have read majority-committed data. Otherwise, the
:readconcern:`"majority"` read concern provides no guarantees that
read operations read majority-committed data.
read operations read majority-committed data. [#psa]_

- For :readconcern:`"snapshot"` read concern, if the transaction
commits with :ref:`write concern "majority"
Expand All @@ -314,6 +317,16 @@ If unspecified at the transaction start, transactions use the
session-level read concern or, if that is unset, the client-level read
concern.

.. [#psa]

For a three-member Primary-Secondary-Arbiter (PSA) replica set
architecture, you may have :ref:`disabled read concern "majority"
<4.0-disable-read-concern-majority>` to avoid cache pressure.
Disabling :readconcern:`"majority"` does not affect transactions;
i.e. you can specify read concern :readconcern:`"majority"` for
transactions even if read concern :readconcern:`"majority"` is
disabled.

.. _transactions-write-concern:

Write Concern
Expand Down
24 changes: 15 additions & 9 deletions source/includes/extracts-transactions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,19 @@ content: |
---
ref: transactions-read-concern-tip
content: |
In MongoDB 4.0, all multi-documents transactions have ``snapshot`` isolation. In
future versions of MongoDB, the server will optimize around your specified read
concern (isolation level).

For :readconcern:`"local"` and :readconcern:`"majority"` read concern, MongoDB
may provide stronger isolation guarantees than specified. If stronger guarantees
are needed, be explicit as future versions of the server may include
optimizations that remove stronger isolation guarantees than explicitly
specified.

For :readconcern:`"local"` and :readconcern:`"majority"` read
concern, MongoDB may provide stronger isolation guarantees than
specified. Specifically, in MongoDB 4.0, all multi-documents
transactions have :readconcern:`"snapshot"` isolation.

In future versions of MongoDB, the server will optimize around the
specified read concern (isolation level) instead of providing
stronger isolation guarantees than explicitly specified.

As such, if stronger guarantees than :readconcern:`"local"` and
:readconcern:`"majority"` read concern are needed, explicitly
specify the appropriate read concern instead of relying on MongoDB
to promote the read concern level.

...
4 changes: 4 additions & 0 deletions source/includes/fact-enable-majority-readConcern.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
To use :term:`read concern` level of :readconcern:`"majority"`, replica
sets must use :ref:`WiredTiger storage engine <storage-wiredtiger>`.

For MongoDB 4.0.3+ (and 3.6.1+), you can disable read concern
:readconcern:`"majority"`. For more information, see
:ref:`4.0-disable-read-concern-majority`.
11 changes: 4 additions & 7 deletions source/includes/options-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1900,13 +1900,10 @@ replacement:
program: conf
name: replication.enableMajorityReadConcern
directive: setting
description: |

.. deprecated:: 3.6

Starting in MongoDB 3.6, :readconcern:`"majority"` read concern
is always enabled, and this setting has no effect.

inherit:
name: enableMajorityReadConcern
program: mongod
file: options-mongod.yaml
---
program: conf
name: sharding.configsvrMode
Expand Down
33 changes: 29 additions & 4 deletions source/includes/options-mongod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2203,13 +2203,38 @@ program: mongod
name: enableMajorityReadConcern
directive: option
optional: true
args: null
default: true
description: |

.. deprecated:: 3.6
Starting in MongoDB 3.6, MongoDB enables support for
:readconcern:`"majority"` read concern by default.

For MongoDB 4.0.3+ and 3.6.1+, you can disable read concern
:readconcern:`"majority"` to prevent the storage cache pressure from
immobilizing a deployment with a three-member
primary-secondary-arbiter (PSA) architecture. For more information
about disabling read concern :readconcern:`"majority"`, see
:ref:`4.0-disable-read-concern-majority`.

To disable, set {{role}} to false.

.. important::

In general, avoid disabling :readconcern:`"majority"` read concern
unless necessary. However, if you have a three-member replica set
with a primary-secondary-arbiter (PSA) architecture or a sharded
cluster with a three-member PSA shards, disable to prevent the
storage cache pressure from immobilizing the deployment.

Disabling :readconcern:`"majority"` read concern disables support
for :doc:`/changeStreams`.

Disabling :readconcern:`"majority"` does not affect
:doc:`multi-document transactions </core/transactions>`; i.e. you
can specify read concern "majority" for multi-document
transactions even if read concern "majority" is disabled.

Starting in MongoDB 3.6, :readconcern:`"majority"` read concern
is always enabled, and this option has no effect.
{{role}} has no effect for MongoDB versions: 4.0.0, 4.0.1, 4.0.2, 3.6.0.

---
program: mongod
Expand Down
33 changes: 28 additions & 5 deletions source/includes/steps-change-replica-set-wiredtiger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pre: |
action:
language: sh
code: |
use admin
db.shutdownServer()
---
title: "Prepare a data directory for the new ``mongod`` running with WiredTiger."
Expand All @@ -21,19 +22,41 @@ pre: |
---
title: "Start ``mongod`` with WiredTiger."
ref: change-wt-repl-sync-start-mongod-w-wiredtiger
pre: |
content: |
Start :binary:`~bin.mongod`, specifying ``wiredTiger`` as the
:option:`--storageEngine <mongod --storageEngine>` and the prepared data directory for
WiredTiger as the :option:`--dbpath <mongod --dbpath>`. Specify additional options,
such as :option:`--bind_ip <mongod --bind_ip>`, as appropriate for this replica set
member.

.. include:: /includes/warning-bind-ip-security-considerations.rst

.. tabs::

tabs:
- id: general
name: General Use (For Most Architectures)
content: |
.. code-block:: sh

mongod --storageEngine wiredTiger --dbpath <newWiredTigerDBPath> --replSet <replSetName> --bind_ip localhost,<hostname(s)|ip address(es)>


- id: psa36
name: PSA Architecture
content: |

.. important::

If you are running a three-member PSA architecture and
MongoDB version 4.0.3+, include
:option:`--enableMajorityReadConcern false <mongod
--enableMajorityReadConcern>` to disable read concern ``majority``. |seemore|

.. code-block:: sh

mongod --storageEngine wiredTiger --dbpath <newWiredTigerDBPath> --replSet <replSetName> --bind_ip localhost,<hostname(s)|ip address(es)> --enableMajorityReadConcern false

action:
language: sh
code: |
mongod --storageEngine wiredTiger --dbpath <newWiredTigerDBPath> --replSet <replSetName> --bind_ip localhost,<hostname(s)|ip address(es)>
post: |
Since no data exists in the ``--dbpath``, the ``mongod`` will perform an
:doc:`initial sync </tutorial/resync-replica-set-member>`. The length of the
Expand Down
2 changes: 1 addition & 1 deletion source/reference/configuration-options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ LDAP Parameters
oplogSizeMB: <int>
replSetName: <string>
secondaryIndexPrefetch: <string>
enableMajorityReadConcern: <boolean> ## Deprecated in 3.6
enableMajorityReadConcern: <boolean>

.. include:: /includes/option/setting-conf-replication.oplogSizeMB.rst

Expand Down
6 changes: 6 additions & 0 deletions source/reference/method/Mongo.watch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ Full Document Lookup of Update Operations

.. include:: /includes/extracts/changestream-full-document-lookup.rst

Availability
~~~~~~~~~~~~

Change stream is only available if :readconcern:`"majority"` read
concern support is enabled (default).

Access Control
--------------

Expand Down
5 changes: 5 additions & 0 deletions source/reference/method/db.collection.watch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ Behavior
- For a sharded cluster, you must issue :method:`db.watch()` on a
:binary:`~bin.mongos` instance.

Availability
~~~~~~~~~~~~

Change stream is only available if :readconcern:`"majority"` read
concern support is enabled (default).

Resumability
~~~~~~~~~~~~
Expand Down
6 changes: 6 additions & 0 deletions source/reference/method/db.watch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ Full Document Lookup of Update Operations

.. include:: /includes/extracts/changestream-full-document-lookup.rst

Availability
~~~~~~~~~~~~

Change stream is only available if :readconcern:`"majority"` read
concern support is enabled (default).

Access Control
--------------

Expand Down
2 changes: 2 additions & 0 deletions source/reference/read-concern-local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Causally Consistent Sessions
Read concern :readconcern:`local` is available for use with causally
consistent sessions.

.. _readconcern-local-txn:

Read Concern ``"local"`` and Transactions
-----------------------------------------

Expand Down
45 changes: 44 additions & 1 deletion source/reference/read-concern-majority.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ data read in transactions.

.. include:: /includes/fact-readConcern-most-recent-data-in-node.rst


Example
-------

Expand Down Expand Up @@ -96,6 +95,8 @@ Causally Consistent Sessions
Read concern :readconcern:`majority` is available for use with causally
consistent sessions.

.. _readconcern-majority-txn:

Read Concern ``"majority"`` and Transactions
--------------------------------------------

Expand All @@ -122,4 +123,46 @@ Read Your Own Writes

.. include:: /includes/fact-read-own-writes.rst

.. _4.0-disable-read-concern-majority:

Disable Read Concern Majority
-----------------------------

*For 3-Member Primary-Secondary-Arbiter Architecture*

For MongoDB 4.0.3+ (and 3.6.1+ [#]_), you can disable read concern
:readconcern:`"majority"` if you have a three-member replica set with a
primary-secondary-arbiter (PSA) architecture or a sharded cluster with
a three-member PSA shards.

With a three-member PSA architecture, the cache pressure will increase
if any data bearing node is down. To prevent the storage cache pressure
from immobilizing a deployment with a PSA architecture, you can disable
read concern by setting either:

- :option:`--enableMajorityReadConcern <mongod
--enableMajorityReadConcern>` command line option to ``false``.

- :setting:`replication.enableMajorityReadConcern` configuration file
setting to ``false``.

.. important::

In general, avoid disabling :readconcern:`"majority"` read concern
unless necessary. However, if you have a three-member replica set
with a primary-secondary-arbiter (PSA) architecture or a sharded
cluster with a three-member PSA shards, disable to prevent the
storage cache pressure from immobilizing the deployment.

Disabling :readconcern:`"majority"` read concern disables support
for :doc:`/changeStreams`.

Disabling :readconcern:`"majority"` does not affect
:doc:`multi-document transactions </core/transactions>`; i.e. you
can specify read concern :readconcern:`"majority"` for transactions
even if read concern :readconcern:`"majority"` is disabled.

.. [#]

For MongoDB 3.6 discussion, see :v3.6:`Disable Read Concern Majority
</reference/read-concern-majority/#disable-read-concern-majority>`.
Loading