File tree Expand file tree Collapse file tree 5 files changed +23
-47
lines changed Expand file tree Collapse file tree 5 files changed +23
-47
lines changed Original file line number Diff line number Diff line change 1
1
Possible read concern levels are:
2
2
3
3
- :readconcern: `"local" `. This is the default read concern level for
4
- read operations against primary and read operations against
5
- secondaries when associated with :ref: `causally consistent sessions
6
- <causal-consistency>`.
4
+ read operations against the primary and secondaries.
7
5
8
- - :readconcern: `"available" `. This is the default for reads against
9
- secondaries when when not associated with :ref: ` causally consistent
10
- sessions <causal-consistency>`. The query returns the instance's most
11
- recent data.
6
+ - :readconcern: `"available" `. Available for read operations against
7
+ the primary and secondaries. :readconcern: ` "available" ` behaves the
8
+ same as :readconcern: ` "local" ` against the primary and non-sharded
9
+ secondaries. The query returns the instance's most recent data.
12
10
13
11
- :readconcern: `"majority" `. Available for replica sets that use
14
12
:ref: `WiredTiger storage engine <storage-wiredtiger >`.
Original file line number Diff line number Diff line change @@ -49,8 +49,7 @@ follows:
49
49
- This read concern :red:`does not` guarantee :ref:`causal
50
50
consistency <sessions>`.
51
51
52
- * - | Reads against secondaries if the reads are
53
- | associated with :ref:`causally consistent sessions <sessions>`.
52
+ * - | Reads against secondaries.
54
53
55
54
- :readconcern:`"local"`
56
55
@@ -63,22 +62,6 @@ follows:
63
62
consistency <sessions>`.
64
63
65
64
66
- * - | Reads against secondaries if the reads are :red:`not`
67
- | associated with :ref:`causally consistent sessions <sessions>`.
68
-
69
- - :readconcern:`"available"`
70
-
71
- .. note::
72
-
73
- - This read concern can return data that may be rolled
74
- back.
75
-
76
- - This read concern :red:`does not` guarantee :ref:`causal
77
- consistency <sessions>`.
78
-
79
- - For sharded collections, this read concern can also return
80
- :red:`orphaned documents`.
81
-
82
65
.. _mongodb-default-rc-outside-transactions:
83
66
84
67
.. _mongodb-default-rc-txns:
Original file line number Diff line number Diff line change @@ -17,12 +17,8 @@ A query with read concern ``"local"`` returns data from the instance
17
17
with no guarantee that the data has been written to a majority of the
18
18
replica set members (i.e. may be rolled back).
19
19
20
- Read concern ``"local"`` is the default for:
21
-
22
- - read operations against primary
23
-
24
- - read operations against secondaries if the reads are associated with
25
- :ref:`causally consistent sessions <sessions>`.
20
+ Read concern ``"local"`` is the default for read operations against the
21
+ primary and secondaries.
26
22
27
23
.. include:: /includes/fact-readConcern-most-recent-data-in-node.rst
28
24
Original file line number Diff line number Diff line change @@ -54,19 +54,7 @@ The following read concern levels are available:
54
54
the data has been written to a majority of the replica set
55
55
members (i.e. may be rolled back).
56
56
57
- Default for:
58
- - reads against primary
59
-
60
- - reads against secondaries if the reads are
61
- associated with :ref:`causally consistent sessions <sessions>`.
62
-
63
- .. note::
64
-
65
- Causally consistent client sessions only guarantee
66
- causal consistency if the associated read operations use
67
- :readconcern:`"majority"` read concern and the
68
- associated write operations use
69
- :writeconcern:`"majority"` write concern.
57
+ Default for reads against the primary and secondaries.
70
58
71
59
**Availability:** Read concern :readconcern:`"local"` is available
72
60
for use with or without causally consistent sessions and
@@ -81,9 +69,6 @@ The following read concern levels are available:
81
69
that the data has been written to a majority of the replica set
82
70
members (i.e. may be rolled back).
83
71
84
- **Default for:** reads against secondaries if the reads are :red:`not`
85
- associated with :ref:`causally consistent sessions <sessions>`.
86
-
87
72
**Availability:** Read concern :readconcern:`"available"` is
88
73
:red:`unavailable for use` with causally consistent sessions and
89
74
transactions.
Original file line number Diff line number Diff line change @@ -166,6 +166,20 @@ Read Concern ``snapshot`` on Capped Collections
166
166
167
167
.. include:: /includes/extracts/transactions-capped-collection-read-change.rst
168
168
169
+
170
+ ``local`` is the Default Read Concern
171
+ -------------------------------------
172
+
173
+ Starting in MongoDB 5.0, :readconcern:`"local"` is the default read
174
+ concern level for read operations against the primary and secondaries.
175
+
176
+ This may introduce a significant latency increase for count queries that
177
+ use a filter and for :ref:`covered queries <covered-queries>`.
178
+
179
+ You can opt out of this behavior by setting the cluster-wide
180
+ :ref:`read concern <read-concern>` with
181
+ :dbcommand:`setDefaultRWConcern`.
182
+
169
183
Update Operator Changes
170
184
-----------------------
171
185
You can’t perform that action at this time.
0 commit comments