Skip to content

DOCS-6874, DOCS-6942: read concern changes #2517

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 3 commits 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
5 changes: 2 additions & 3 deletions source/core/sharded-cluster-config-servers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ MongoDB reads data from the config server in the following cases:
- After change in the cluster metadata, such as after a chunk
migration.

When reading from the replica set config servers, MongoDB uses
a :doc:`readConcern </reference/readConcern>` level of
:readconcern:`"majority"`.
When reading from the replica set config servers, MongoDB uses a
:doc:`/reference/read-concern` level of :readconcern:`"majority"`.

Config Server Availability
--------------------------
Expand Down
2 changes: 1 addition & 1 deletion source/includes/apiargs-dbcommand-aggregate-field.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ name: readConcern
type: document
optional: true
description: |
Specifies the :doc:`/reference/readConcern`.
Specifies the :term:`read concern`.

.. include:: /includes/fact-enable-majority-readConcern.rst

Expand Down
16 changes: 8 additions & 8 deletions source/includes/apiargs-dbcommand-count-field.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ operation: count
optional: true
position: 5
type:
- String
- string
- document
---
name: readConcern
position: 6
type: document
arg_name: field
description: |
Specifies the :doc:`/reference/readConcern`.
Specifies the :term:`read concern`.

.. include:: /includes/fact-enable-majority-readConcern.rst

.. include:: /includes/fact-count-readConcern.rst

.. versionadded:: 3.2
optional: true
operation: count
arg_name: field
interface: dbcommand
name: readConcern
operation: count
optional: true
position: 6
type: document
...
2 changes: 1 addition & 1 deletion source/includes/apiargs-dbcommand-distinct-field.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ name: readConcern
position: 4
type: document
description: |
Specifies the :doc:`/reference/readConcern`.
Specifies the :term:`read concern`.

.. include:: /includes/fact-enable-majority-readConcern.rst

Expand Down
4 changes: 2 additions & 2 deletions source/includes/apiargs-dbcommand-find-field.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ name: readConcern
type: document
optional: true
description: |
Specifies the :doc:`/reference/readConcern`.
Specifies the :term:`read concern`.

.. include:: /includes/fact-enable-majority-readConcern.rst

Expand Down Expand Up @@ -269,4 +269,4 @@ arg_name: field
operation: find
interface: command
position: 23
...
...
2 changes: 1 addition & 1 deletion source/includes/apiargs-dbcommand-geoNear-field.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ name: readConcern
position: 12
type: document
description: |
Specifies the :doc:`/reference/readConcern`.
Specifies the :term:`read concern`.

.. include:: /includes/fact-enable-majority-readConcern.rst

Expand Down
2 changes: 1 addition & 1 deletion source/includes/apiargs-dbcommand-geoSearch-field.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ name: readConcern
position: 6
type: document
description: |
Specifies the :doc:`/reference/readConcern`.
Specifies the :term:`read concern`.

.. include:: /includes/fact-enable-majority-readConcern.rst

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ name: readConcern
position: 3
type: document
description: |
Specifies the :doc:`/reference/readConcern`.
Specifies the :term:`read concern`.

.. include:: /includes/fact-enable-majority-readConcern.rst

Expand Down
4 changes: 2 additions & 2 deletions source/includes/apiargs-method-cursor.readConcern-param.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: level
arg_name: param
description: |
One of the following :term:`read concern` modes: :readconcern:`"local"` or
:readconcern:`"majority"`
One of the following :term:`read concern` modes:
:readconcern:`"local"` or :readconcern:`"majority"`
interface: method
operation: cursor.readConcern
optional: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
arg_name: field
description: |
The maximum number of documents to count.
interface: method
name: limit
operation: db.collection.count
optional: true
position: 1
type: integer
---
arg_name: field
description: |
The number of documents to skip before counting.
interface: method
name: skip
operation: db.collection.count
optional: true
position: 2
type: integer
---
arg_name: field
description: |
An index name hint or specification for the query.

.. versionadded:: 2.6
interface: method
name: hint
operation: db.collection.count
optional: true
position: 3
type:
- string
- document
---
arg_name: field
description: |
The maximum amount of time to allow the query to run.
interface: method
name: maxTimeMS
operation: db.collection.count
optional: true
position: 4
type: integer
---
arg_name: field
description: |
Specifies the :term:`read concern`.

.. include:: /includes/fact-enable-majority-readConcern.rst

.. include:: /includes/fact-count-readConcern.rst

.. versionadded:: 3.2
interface: method
name: readConcern
operation: db.collection.count
optional: true
position: 4
type: string
...
10 changes: 10 additions & 0 deletions source/includes/apiargs-method-db.collection.count-param.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,14 @@ operation: db.collection.count
optional: false
position: 1
type: document
---
arg_name: param
description: |
Extra options for modifying the count.
interface: method
name: options
operation: db.collection.count
optional: true
position: 2
type: document
...
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ content: |
.. versionchanged:: 3.2

For replica sets and sharded clusters, MongoDB provides monotonic
reads if read operations specify :doc:`/reference/readConcern`
reads if read operations specify :doc:`/reference/read-concern`
``"majority"`` and read preference :readmode:`primary`.

In previous versions, MongoDB cannot make monotonic read
Expand Down
2 changes: 1 addition & 1 deletion source/includes/fact-aggregate-readConcern.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
To use a :doc:`/reference/readConcern` level of :readconcern:`"majority"`, you
To use a :doc:`/reference/read-concern` level of :readconcern:`"majority"`, you
cannot include the :pipeline:`$out` stage.
4 changes: 2 additions & 2 deletions source/includes/fact-count-readConcern.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
To use a :doc:`/reference/readConcern` level of :readconcern:`"majority"`, you
must specify a nonempty ``query`` condition.
To use a :term:`read concern` level of :readconcern:`"majority"`, you must
specify a nonempty ``query`` condition.
11 changes: 5 additions & 6 deletions source/includes/fact-enable-majority-readConcern.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
To use a :doc:`/reference/readConcern` level of
:readconcern:`"majority"`, you must use the WiredTiger storage engine
and start the :program:`mongod` instances with the
:option:`--enableMajorityReadConcern` command line option (or the
:setting:`replication.enableMajorityReadConcern` setting if using a
configuration file).
To use a :term:`read concern` level of :readconcern:`"majority"`, you
must use the WiredTiger storage engine and start the :program:`mongod`
instances with the :option:`--enableMajorityReadConcern` command line
option (or the :setting:`replication.enableMajorityReadConcern` setting
if using a configuration file).

.. include:: /includes/fact-readConcern-majority-protocolVersion.rst
5 changes: 3 additions & 2 deletions source/includes/fact-readConcern-majority-protocolVersion.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Only replica sets using :rsconf:`protocol version 1 <protocolVersion>`
support :readconcern:`"majority"` readConcern. Replica sets running protocol
version 0 do not support :readconcern:`"majority"` readConcern.
support :readconcern:`"majority"` read concern. Replica sets running
protocol version 0 do not support :readconcern:`"majority"` read
concern.
5 changes: 2 additions & 3 deletions source/includes/fact-readConcern-most-recent-data-in-node.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Regardless of the :doc:`/reference/readConcern` level, the most recent
data on a node may not reflect the most recent version of the data in the
system.
Regardless of the :term:`read concern` level, the most recent data on a
node may not reflect the most recent version of the data in the system.
3 changes: 1 addition & 2 deletions source/includes/options-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1724,8 +1724,7 @@ description: |

.. versionadded:: 3.2

Enables :doc:`readConcern </reference/readConcern>` level of
``"majority"``.
Enables :term:`read concern` level of ``"majority"``.
---
program: conf
name: sharding.configsvrMode
Expand Down
4 changes: 2 additions & 2 deletions source/includes/options-mongod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2020,8 +2020,8 @@ description: |

.. versionadded:: 3.2

Enables :doc:`readConcern </reference/readConcern>` level of
``"majority"``. By default, ``"majority"`` level is not enabled.
Enables :term:`read concern` level of ``"majority"``. By default,
``"majority"`` level is not enabled.
---
program: mongod
name: configsvrMode
Expand Down
2 changes: 1 addition & 1 deletion source/includes/ref-toc-method-cursor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ description: "Configures the cursor to display results in an easy-to-read format
---
name: ":method:`cursor.readConcern()`"
file: /reference/method/cursor.readConcern
description: "Specifies a :term:`read concern` for a :method:`find() <db.collection.find()>` or :method:`count() <db.collection.count()>` operation."
description: "Specifies a :term:`read concern` for a :method:`find() <db.collection.find()>` operation."
---
name: ":method:`cursor.readPref()`"
file: /reference/method/cursor.readPref
Expand Down
2 changes: 1 addition & 1 deletion source/includes/toc-crud-reference.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ file: /reference/write-concern
description: |
Description of the write operation acknowledgements returned by MongoDB.
---
file: /reference/readConcern
file: /reference/read-concern
description: |
Description of the ``readConcern`` option.
---
Expand Down
2 changes: 1 addition & 1 deletion source/reference/command/aggregate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Override Default ``readConcern``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The following operation on a replica set specifies a
:doc:`/reference/readConcern` of :readconcern:`"majority"` to read the
:doc:`/reference/read-concern` of :readconcern:`"majority"` to read the
most recent copy of the data confirmed as having been written to a
majority of the nodes.

Expand Down
16 changes: 10 additions & 6 deletions source/reference/command/count.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@ Definition

Counts the number of documents in a collection. Returns a document
that contains this count and as well as the command status.
:dbcommand:`count` has the following form:

.. versionchanged:: 2.6
:dbcommand:`count` now accepts the ``hint`` option to specify an
index.
:dbcommand:`count` has the following form:

.. code-block:: javascript

{ count: <collection>, query: <query>, limit: <limit>, skip: <skip>, hint: <hint> }
{
count: <collection-name>,
query: <document>,
limit: <integer>,
skip: <integer>,
hint: <hint>,
readConcern: <document>
}

:dbcommand:`count` has the following fields:

Expand Down Expand Up @@ -143,7 +147,7 @@ Override Default ``readConcern``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The following operation on a replica set specifies a
:doc:`/reference/readConcern` of :readconcern:`"majority"` to read the
:doc:`/reference/read-concern` of :readconcern:`"majority"` to read the
most recent copy of the data confirmed as having been written to a
majority of the nodes.

Expand Down
2 changes: 1 addition & 1 deletion source/reference/command/distinct.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Override Default ``readConcern``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The following operation on a replica set specifies a
:doc:`/reference/readConcern` of :readconcern:`"majority"` to read the
:doc:`/reference/read-concern` of :readconcern:`"majority"` to read the
most recent copy of the data confirmed as having been written to a
majority of the nodes.

Expand Down
6 changes: 3 additions & 3 deletions source/reference/command/find.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ field and limits the result set to 5 documents.
Override Default ``readConcern``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The following operation on a replica set specifies a :doc:`/reference/readConcern`
of :readconcern:`"majority"` to read the most recent copy of the data
confirmed as having been written to a majority of the nodes.
The following operation on a replica set specifies a :term:`read
concern` of :readconcern:`"majority"` to read the most recent copy of
the data confirmed as having been written to a majority of the nodes.

.. note::

Expand Down
2 changes: 1 addition & 1 deletion source/reference/command/geoNear.txt
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ Override Default ``readConcern``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The following operation on a replica set specifies a
:doc:`/reference/readConcern` of :readconcern:`"majority"` to read the
:doc:`/reference/read-concern` of :readconcern:`"majority"` to read the
most recent copy of the data confirmed as having been written to a
majority of the nodes.

Expand Down
2 changes: 1 addition & 1 deletion source/reference/command/geoSearch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Override Default ``readConcern``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The following operation on a replica set specifies a
:doc:`/reference/readConcern` of :readconcern:`"majority"` to read the
:doc:`/reference/read-concern` of :readconcern:`"majority"` to read the
most recent copy of the data confirmed as having been written to a
majority of the nodes.

Expand Down
2 changes: 1 addition & 1 deletion source/reference/command/parallelCollectionScan.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Example
-------

The following operation on a replica set specifies a
:doc:`/reference/readConcern` of :readconcern:`"majority"` to read the
:doc:`/reference/read-concern` of :readconcern:`"majority"` to read the
most recent copy of the data confirmed as having been written to a
majority of the nodes.

Expand Down
4 changes: 2 additions & 2 deletions source/reference/connection-string.txt
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,15 @@ full explanation of write concern and write operations in general, see
For the WiredTiger storage engine, MongoDB 3.2 introduces the
readConcern option for replica sets and replica set shards.

:doc:`/reference/readConcern` allows clients to choose a level of
:doc:`/reference/read-concern` allows clients to choose a level of
isolation for their reads from replica sets.

.. data:: uri.readConcernLevel

The level of isolation. Accepts either :readconcern:`"local"` or
:readconcern:`"majority"`.

For details, see :doc:`/reference/readConcern`.
For details, see :doc:`/reference/read-concern`.

Read Preference Options
~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion source/reference/glossary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ Glossary
Specifies a level of isolation for read operations. For example,
you can use read concern to only read data that has propagated to
a majority of nodes in a :term:`replica set`. See
:doc:`Read Concern </reference/readConcern>`.
:doc:`/reference/read-concern`.

read preference
A setting that determines how clients direct read operations.
Expand Down
Loading