Skip to content

Commit b498ef0

Browse files
committed
ODCS-12081: blurb about txns and disabling majority read concern
1 parent d69b3a3 commit b498ef0

File tree

5 files changed

+44
-12
lines changed

5 files changed

+44
-12
lines changed

source/core/transactions.txt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,17 +273,20 @@ Read Concern
273273

274274
Multi-document transactions support read concern
275275
:readconcern:`"snapshot"`, :readconcern:`"local"`, and
276-
:readconcern:`"majority"`:
276+
:readconcern:`"majority"` :
277277

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

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

288291
- For :readconcern:`"snapshot"` read concern, if the transaction
289292
commits with :ref:`write concern "majority"
@@ -307,6 +310,16 @@ If unspecified at the transaction start, transactions use the
307310
session-level read concern or, if that is unset, the client-level read
308311
concern.
309312

313+
.. [#psa]
314+
315+
For a three-member Primary-Secondary-Arbiter (PSA) replica set
316+
architecture, you may have :ref:`disabled read concern "majority"
317+
<4.0-disable-read-concern-majority>` to avoid cache pressure.
318+
Disabling :readconcern:`"majority"` does not affect transactions;
319+
i.e. you can specify read concern :readconcern:`"majority"` for
320+
transactions even if read concern :readconcern:`"majority"` is
321+
disabled.
322+
310323
.. _transactions-write-concern:
311324

312325
Write Concern

source/includes/extracts-transactions.yaml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,19 @@ content: |
141141
---
142142
ref: transactions-read-concern-tip
143143
content: |
144-
In MongoDB 4.0, all multi-documents transactions have ``snapshot`` isolation. In
145-
future versions of MongoDB, the server will optimize around your specified read
146-
concern (isolation level).
147-
148-
For :readconcern:`"local"` and :readconcern:`"majority"` read concern, MongoDB
149-
may provide stronger isolation guarantees than specified. If stronger guarantees
150-
are needed, be explicit as future versions of the server may include
151-
optimizations that remove stronger isolation guarantees than explicitly
152-
specified.
144+
145+
For :readconcern:`"local"` and :readconcern:`"majority"` read
146+
concern, MongoDB may provide stronger isolation guarantees than
147+
specified. Specifically, in MongoDB 4.0, all multi-documents
148+
transactions have :readconcern:`"snapshot"` isolation.
149+
150+
In future versions of MongoDB, the server will optimize around the
151+
specified read concern (isolation level) instead of providing
152+
stronger isolation guarantees than explicitly specified.
153+
154+
As such, if stronger guarantees than :readconcern:`"local"` and
155+
:readconcern:`"majority"` read concern are needed, explicitly
156+
specify the appropriate read concern instead of relying on MongoDB
157+
to promote the read concern level.
158+
153159
...

source/includes/options-mongod.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2214,6 +2214,11 @@ description: |
22142214
Disabling :readconcern:`"majority"` read concern disables support
22152215
for :doc:`/changeStreams`.
22162216
2217+
Disabling :readconcern:`"majority"` does not affect
2218+
:doc:`multi-document transactions </core/transactions>`; i.e. you
2219+
can specify read concern "majority" for multi-document
2220+
transactions even if read concern "majority" is disabled.
2221+
22172222
{{role}} has no effect for MongoDB versions: 4.0.0, 4.0.1, 4.0.2, 3.6.0.
22182223
22192224
---

source/reference/read-concern-local.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Causally Consistent Sessions
3232
Read concern :readconcern:`local` is available for use with causally
3333
consistent sessions.
3434

35+
.. _readconcern-local-txn:
36+
3537
Read Concern ``"local"`` and Transactions
3638
-----------------------------------------
3739

source/reference/read-concern-majority.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ data read in transactions.
3131

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

34-
3534
Example
3635
-------
3736

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

98+
.. _readconcern-majority-txn:
99+
99100
Read Concern ``"majority"`` and Transactions
100101
--------------------------------------------
101102

@@ -156,6 +157,11 @@ read concern by setting either:
156157
Disabling :readconcern:`"majority"` read concern disables support
157158
for :doc:`/changeStreams`.
158159

160+
Disabling :readconcern:`"majority"` does not affect
161+
:doc:`multi-document transactions </core/transactions>`; i.e. you
162+
can specify read concern :readconcern:`"majority"` for transactions
163+
even if read concern :readconcern:`"majority"` is disabled.
164+
159165
.. [#]
160166

161167
For MongoDB 3.6 discussion, see :v3.6:`Disable Read Concern Majority

0 commit comments

Comments
 (0)