Skip to content

Commit 2366a34

Browse files
committed
DOCS-11001,DOCS-10838 read concern available
1 parent 126c4cc commit 2366a34

File tree

4 files changed

+79
-31
lines changed

4 files changed

+79
-31
lines changed

source/core/read-preference.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ in the cluster.
135135
In the :program:`mongo` shell, the :method:`~cursor.readPref()` cursor
136136
method provides access to read preferences.
137137

138-
For more information, see :ref:`read preference background
139-
<replica-set-read-preference-background>` and :ref:`read preference
138+
For more information, see :ref:`read preference
140139
behavior <replica-set-read-preference-behavior>`. See also the
141140
:api:`documentation for your driver <>`.
142141

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
- Regardless of :doc:`write concern </reference/write-concern>`, other
2-
clients using :readconcern:`"local"` (i.e. the default) readConcern
3-
can see the result of a write operation before the write operation is
4-
acknowledged to the issuing client.
2+
clients using :readconcern:`"local"` or :readconcern:`"available"`
3+
readConcern can see the result of a write operation before the write
4+
operation is acknowledged to the issuing client.
55

6-
- Clients using :readconcern:`"local"` (i.e. the default) readConcern
7-
can read data which may be subsequently :doc:`rolled back
6+
- Clients using :readconcern:`"local"` or :readconcern:`"available"`
7+
readConcern can read data which may be subsequently :doc:`rolled back
88
</core/replica-set-rollbacks>`.

source/reference/read-concern.txt

Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
Read Concern
55
============
66

7+
.. versionadded:: 3.2
8+
79
.. default-domain:: mongodb
810

911
.. contents:: On this page
@@ -12,23 +14,23 @@ Read Concern
1214
:depth: 1
1315
:class: singlecol
1416

15-
.. versionchanged:: 3.6
16-
17-
Add support for :ref:`afterClusterTime` for :readconcern:`"local"`
18-
and :readconcern:`"majority"` read concern level.
19-
2017
.. versionchanged:: 3.4
18+
Adds support for :readconcern:`"linearizable"` read concern level.
2119

22-
Adds support for :readconcern:`"linearizable"` read concern level.
20+
.. versionchanged:: 3.6
21+
Adds support for:
2322

24-
.. versionadded:: 3.2
23+
- :readconcern:`"available"` read concern level.
24+
25+
- :ref:`afterClusterTime` for :readconcern:`"local"` and
26+
:readconcern:`"majority"` read concern levels.
2527

2628
The ``readConcern`` query option for replica sets and replica set
2729
shards determines which data to return from a query.
2830

2931
.. code-block:: javascript
3032

31-
readConcern: { level: <"majority"|"local"|"linearizable"> }
33+
readConcern: { level: <"majority"|"local"|"linearizable"|"available"> }
3234
readConcern: { level: <"majority"|"local"> , afterClusterTime: <Timestamp> }
3335

3436
.. _read-concern-levels:
@@ -47,9 +49,40 @@ The following read concern levels are available:
4749

4850
* - .. readconcern:: "local"
4951

50-
- Default. The query returns the instance's most recent data.
51-
Provides no guarantee that the data has been written to a
52-
majority of the replica set members (i.e. may be rolled back).
52+
- Default for reads against primary if ``level`` is unspecified
53+
and for reads against secondaries if ``level`` is unspecified but
54+
:ref:`afterClusterTime` is specified.
55+
56+
The query returns the instance's most recent data. Provides no
57+
guarantee that the data has been written to a majority of the
58+
replica set members (i.e. may be rolled back).
59+
60+
* - .. readconcern:: "available"
61+
62+
- Default for reads against secondaries when
63+
:ref:`afterClusterTime` and ``level`` are unspecified.
64+
65+
The query returns the the instance's most recent data. Provides
66+
no guarantee that the data has been written to a majority of the
67+
replica set members (i.e. may be rolled back).
68+
69+
For unsharded collections (including collections in a standalone
70+
deployment or a replica set deployment), :readconcern:`"local"`
71+
and :readconcern:`"available"` read concerns behave identically.
72+
73+
For a sharded cluster, :readconcern:`"available"` read concern
74+
provides greater tolerance for partitions since it does not wait
75+
to ensure consistency guarantees. However, a query with
76+
:readconcern:`"available"` read concern may return orphan
77+
documents if the shard is undergoing chunk migrations since the
78+
:readconcern:`"available"` read concern, unlike
79+
:readconcern:`"local"` read concern, does not contact the
80+
shard's primary nor the config servers for updated
81+
:doc:`metadata </core/sharded-cluster-config-servers>`.
82+
83+
.. seealso:: :parameter:`orphanCleanupDelaySecs`
84+
85+
.. versionadded:: 3.6
5386

5487
* - .. readconcern:: "majority"
5588

@@ -100,13 +133,19 @@ The following read concern levels are available:
100133

101134
.. versionadded:: 3.6
102135

103-
Starting in version 3.6, MongoDB introduces the ``afterClusterTime``
104-
option that can be set by the drivers. Read operations with a specified
105-
``afterClusterTime`` return data that meets the level requirement and
106-
the specified after cluster time requirement.
136+
MongoDB introduces the ``afterClusterTime`` option that can be set by
137+
the drivers. Read operations with a specified ``afterClusterTime``
138+
return data that meets the level requirement and the specified after
139+
cluster time requirement.
140+
141+
.. important::
142+
143+
Do not manually set the ``afterClusterTime``. MongoDB drivers set
144+
this value automatically for operations associated with
145+
:ref:`causally consistent sessions <causal-consistency>`.
107146

108147
:ref:`Causally consistent sessions<causal-consistency>` use
109-
``afterClusterTime`` to provide :ref:`causal consistency`.
148+
``afterClusterTime`` to provide :ref:`causal consistency <causal-consistency>`.
110149

111150
``afterClusterTime`` is available for :readconcern:`"local"` (default)
112151
and :readconcern:`"majority"` read concern levels:
@@ -115,11 +154,9 @@ and :readconcern:`"majority"` read concern levels:
115154

116155
readConcern: { level: <"majority"|"local"> , afterClusterTime: <Timestamp> }
117156

118-
.. important::
119-
120-
Do not manually set the ``afterClusterTime``. MongoDB drivers set
121-
this value automatically for operations associated with
122-
:ref:`causally consistent sessions <causal-consistency>`.
157+
For read operations not associated with causally consistent sessions,
158+
i.e. the ``afterClusterTime`` is unset, reads against secondary members
159+
have the default read concern level :readconcern:`"available"`.
123160

124161
.. _read-concern-storage-engine-drivers:
125162

source/release-notes/3.6.txt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,8 @@ Sharded Clusters
439439
for :program:`mongos` to control the rate at which :program:`mongos`
440440
adds connections to a :program:`mongod` instance.
441441

442+
- Added :parameter:`orphanCleanupDelaySecs` that determines the minimum
443+
delay before a migrated chunk is deleted from the source shard.
442444

443445
General Enhancements
444446
--------------------
@@ -536,9 +538,19 @@ Wire Protocol and Compression
536538
Read Concern
537539
~~~~~~~~~~~~
538540

539-
:readconcern:`"majority"` read concern is always enabled and
540-
deprecates/obsoletes the use of :option:`--enableMajorityReadConcern`
541-
and :setting:`replication.enableMajorityReadConcern`.
541+
- New :readconcern:`"available"` read concern is available. For
542+
unsharded collections (including collections in a standalone
543+
deployment or a replica set deployment), :readconcern:`"local"` and
544+
:readconcern:`"available"` read concerns behave identically. For
545+
sharded clusters, :readconcern:`"available"` provides greater
546+
tolerance for partitions but may return orphan documents if the shard
547+
is undergoing chunk migrations.
548+
549+
.. seealso:: :parameter:`orphanCleanupDelaySecs`
550+
551+
- :readconcern:`"majority"` read concern is always enabled and
552+
deprecates/obsoletes the use of :option:`--enableMajorityReadConcern`
553+
and :setting:`replication.enableMajorityReadConcern`.
542554

543555
FTDC
544556
~~~~

0 commit comments

Comments
 (0)