Skip to content

Commit 4826b57

Browse files
authored
(DOCSP-31297): Backport DOCSP-11123 to v6.0. (#3622) (#3849)
* (DOCSP-11123): Updated the wording around durability. * (DOCSP-11123): Incorporated Melissa's feedback. * (DOCSP-11123): Incorporated Melissa's feedback. * (DOCSP-11123): Incorporated Melissa's feedback.
1 parent cfc54c1 commit 4826b57

File tree

1 file changed

+58
-51
lines changed

1 file changed

+58
-51
lines changed

source/core/causal-consistency-read-write-concerns.txt

Lines changed: 58 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ Causal Consistency and Read and Write Concerns
66

77
With MongoDB's :ref:`causally consistent client sessions <sessions>`,
88
different combinations of read and write concerns provide different
9-
:ref:`causal consistency guarantees <causal-consistency-guarantees>`. When
10-
causal consistency is defined to imply durability, then the following table lists
11-
the specific guarantees provided by the various combinations:
9+
:ref:`causal consistency guarantees <causal-consistency-guarantees>`.
10+
11+
The following table lists the specific guarantees that various
12+
combinations provide:
1213

1314
.. list-table::
1415
:header-rows: 1
@@ -48,24 +49,27 @@ the specific guarantees provided by the various combinations:
4849
- |checkmark|
4950
-
5051

51-
If causal consistency implies durability, then, as seen from the table,
52-
only read operations with :readconcern:`"majority"` read concern and
53-
write operations with :writeconcern:`"majority"` write concern can
54-
guarantee all four causal consistency guarantees. That is,
52+
If you want causal consistency with data durability, then, as
53+
seen from the table, only read operations with
54+
:readconcern:`"majority"` read concern and write operations with
55+
:writeconcern:`"majority"` write concern can guarantee all four causal
56+
consistency guarantees. That is,
5557
:ref:`causally consistent client sessions <sessions>` can only
5658
guarantee causal consistency for:
5759

58-
- Read operations with :readconcern:`"majority"` read concern; i.e. the
59-
read operations that return data that has been acknowledged by a
60-
majority of the replica set members and is durable.
60+
- Read operations with :readconcern:`"majority"` read concern; in other
61+
words, the read operations that return data that has been
62+
acknowledged by a majority of the replica set members and is durable.
6163

62-
- Write operations with :writeconcern:`"majority"` write concern; i.e.
63-
the write operations that request acknowledgement that the operation
64-
has been applied to a majority of the replica set's voting members.
64+
- Write operations with :writeconcern:`"majority"` write concern;
65+
in other words, the write operations that request acknowledgement
66+
that the operation has been applied to a majority of the replica
67+
set's voting members.
6568

66-
If causal consistency does not imply durability (i.e. writes may be
67-
rolled back), then write operations with :writeconcern:`{ w: 1 }
68-
<\<number\>>` write concern can also provide causal consistency.
69+
If you want causal consistency without data durability (meaning that
70+
writes may be rolled back), then write operations with
71+
:writeconcern:`{ w: 1 } <\<number\>>` write concern can also provide
72+
causal consistency.
6973

7074
.. note::
7175

@@ -190,8 +194,8 @@ the following causal consistency guarantees:
190194
* - |checkmark| **Writes follow reads**
191195

192196
- Write\ :sub:`2` updates data on ``P``\ :sub:`new` that
193-
reflects a state of the data after Read\ :sub:`1` (i.e. an
194-
earlier state reflects the data read by Read\ :sub:`1`).
197+
reflects a state of the data after Read\ :sub:`1` (meaning
198+
that an earlier state reflects the data read by Read\ :sub:`1`).
195199

196200
.. note:: Scenario 2 (Read Concern "majority" and Write Concern "majority")
197201

@@ -244,7 +248,7 @@ the following causal consistency guarantees:
244248
* - |checkmark| **Monotonic reads**
245249

246250
- Read\ :sub:`2` reads data from ``S``\ :sub:`3` that reflects
247-
a state after Read\ :sub:`1` (i.e. an earlier state is
251+
a state after Read\ :sub:`1` (meaning that an earlier state is
248252
reflected in the data read by Read\ :sub:`1`).
249253

250254
* - |checkmark| **Monotonic writes**
@@ -255,8 +259,8 @@ the following causal consistency guarantees:
255259
* - |checkmark| **Writes follow reads**
256260

257261
- Write\ :sub:`2` updates data on ``P``\ :sub:`new` that
258-
reflects a state of the data after Read\ :sub:`1` (i.e. an
259-
earlier state reflects the data read by Read\ :sub:`1`).
262+
reflects a state of the data after Read\ :sub:`1` (meaning
263+
that an earlier state reflects the data read by Read\ :sub:`1`).
260264

261265
.. _causal-rc-majority-wc-1:
262266

@@ -265,11 +269,12 @@ Read Concern ``"majority"`` and Write concern ``{w: 1}``
265269

266270
The use of read concern :readconcern:`"majority"` and write concern
267271
:writeconcern:`{ w: 1 } <\<number\>>` in a causally consistent session
268-
provides the following causal consistency guarantees *if causal consistency implies durability*:
272+
provides the following causal consistency guarantees *if you want
273+
causal consistency with data durability*:
269274

270275
|xmark| Read own writes |checkmark| Monotonic reads |xmark| Monotonic writes |checkmark| Writes follow reads
271276

272-
*If causal consistency does not imply durability*:
277+
*If you want causal consistency without data durability*:
273278

274279
|checkmark| Read own writes |checkmark| Monotonic reads |checkmark| Monotonic writes |checkmark| Writes follow reads
275280

@@ -279,8 +284,8 @@ provides the following causal consistency guarantees *if causal consistency impl
279284
:sub:`old` and ``P``\ :sub:`new` can fulfill writes with
280285
:writeconcern:`{ w: 1 } <\<number\>>` write concern, a client session
281286
could issue the following sequence of operations
282-
successfully but not be causally consistent **if causal consistency
283-
implies durability**:
287+
successfully but not be causally consistent **if you want causal
288+
consistency with data durability**:
284289

285290
.. list-table::
286291
:header-rows: 1
@@ -315,21 +320,21 @@ provides the following causal consistency guarantees *if causal consistency impl
315320

316321
- Write\ :sub:`1` will roll back when the network partition is healed.
317322

318-
|arrow| *If causal consistency implies durability*
323+
|arrow| *If you want causal consistency with data durability*
319324

320325
.. list-table::
321326
:class: no-outer-border
322327
:widths: 20 80
323328

324329
* - |xmark| **Read own writes**
325330

326-
- Read\ :sub:`1` reads data from ``S``\ :sub:`2` that does not
331+
- Read\ :sub:`1` reads data from ``S``\ :sub:`2` that doesn't
327332
reflect a state after Write\ :sub:`1`.
328333

329334
* - |checkmark| **Monotonic reads**
330335

331336
- Read\ :sub:`2` reads data from ``S``\ :sub:`3` that reflects
332-
a state after Read\ :sub:`1` (i.e. an earlier state is
337+
a state after Read\ :sub:`1` (meaning that an earlier state is
333338
reflected in the data read by Read\ :sub:`1`).
334339

335340
* - |xmark| **Monotonic writes**
@@ -340,11 +345,11 @@ provides the following causal consistency guarantees *if causal consistency impl
340345
* - |checkmark| **Writes follow reads**
341346

342347
- Write\ :sub:`2` updates data on ``P``\ :sub:`new` that
343-
reflects a state after Read\ :sub:`1` (i.e. an
348+
reflects a state after Read\ :sub:`1` (meaning that an
344349
earlier state reflects the data read by Read\
345350
:sub:`1`).
346351

347-
|arrow| *If causal consistency does not imply durability*
352+
|arrow| *If you want causal consistency without data durability*
348353

349354
.. list-table::
350355
:class: no-outer-border
@@ -359,7 +364,7 @@ provides the following causal consistency guarantees *if causal consistency impl
359364
* - |checkmark| **Monotonic reads**
360365

361366
- Read\ :sub:`2` reads data from ``S``\ :sub:`3` that reflects
362-
a state after Read\ :sub:`1` (i.e. an earlier state is
367+
a state after Read\ :sub:`1` (meaning that an earlier state is
363368
reflected in the data read by Read\ :sub:`1`).
364369

365370
* - |checkmark| **Monotonic writes**
@@ -371,7 +376,7 @@ provides the following causal consistency guarantees *if causal consistency impl
371376
* - |checkmark| **Writes follow reads**
372377

373378
- Write\ :sub:`2` updates data on ``P``\ :sub:`new` that
374-
reflects a state after Read\ :sub:`1` (i.e. whose
379+
reflects a state after Read\ :sub:`1` (meaning whose
375380
earlier state reflects the data read by Read\
376381
:sub:`1`).
377382

@@ -409,21 +414,21 @@ provides the following causal consistency guarantees *if causal consistency impl
409414
:sub:`old` and ``S``\ :sub:`1`, and the two members sync from the
410415
other members of the replica set.
411416

412-
|arrow| *If causal consistency implies durability*
417+
|arrow| *If you want causal consistency with data durability*
413418

414419
.. list-table::
415420
:class: no-outer-border
416421
:widths: 20 80
417422

418423
* - |xmark| **Read own writes**
419424

420-
- The data read by Read\ :sub:`1` does not reflect the results
425+
- The data read by Read\ :sub:`1` doesn't reflect the results
421426
of Write\ :sub:`1`, which has rolled back.
422427

423428
* - |checkmark| **Monotonic reads**
424429

425430
- Read\ :sub:`2` reads data from ``S``\ :sub:`3` that reflects
426-
a state after Read\ :sub:`1` (i.e. whose
431+
a state after Read\ :sub:`1` (meaning whose
427432
earlier state reflects the data read by Read\
428433
:sub:`1`).
429434

@@ -436,10 +441,10 @@ provides the following causal consistency guarantees *if causal consistency impl
436441
* - |checkmark| **Writes follow reads**
437442

438443
- Write\ :sub:`2` updates data on ``P``\ :sub:`new` that
439-
reflects a state after Read\ :sub:`1` (i.e. whose
444+
reflects a state after Read\ :sub:`1` (meaning whose
440445
earlier state reflects the data read by Read\ :sub:`1`).
441446

442-
|arrow| *If causal consistency does not imply durability*
447+
|arrow| *If you want causal consistency without data durability*
443448

444449
.. list-table::
445450
:class: no-outer-border
@@ -453,7 +458,7 @@ provides the following causal consistency guarantees *if causal consistency impl
453458
* - |checkmark| **Monotonic reads**
454459

455460
- Read\ :sub:`2` reads data from ``S``\ :sub:`3` that reflects
456-
a state after Read\ :sub:`1` (i.e. an earlier state
461+
a state after Read\ :sub:`1` (meaning that an earlier state
457462
reflects the data read by Read\ :sub:`1`).
458463

459464
* - |checkmark| **Monotonic writes**
@@ -465,8 +470,8 @@ provides the following causal consistency guarantees *if causal consistency impl
465470
* - |checkmark| **Writes follow reads**
466471

467472
- Write\ :sub:`2` updates data on ``P``\ :sub:`new` that
468-
reflects a state after Read\ :sub:`1` (i.e. an earlier state
469-
reflects the data read by Read\ :sub:`1`).
473+
reflects a state after Read\ :sub:`1` (meaning that an
474+
earlier state reflects the data read by Read\ :sub:`1`).
470475

471476
.. _causal-rc-local-wc-1:
472477

@@ -524,9 +529,9 @@ some situations, but not necessarily in all situations.
524529

525530
* - |xmark| Monotonic reads
526531

527-
- Read\ :sub:`2` reads data from ``S``\ :sub:`3` that does not
528-
reflect a state after Read\ :sub:`1` (i.e. an earlier state
529-
does not reflect the data read by Read\ :sub:`1`).
532+
- Read\ :sub:`2` reads data from ``S``\ :sub:`3` that doesn't
533+
reflect a state after Read\ :sub:`1` (meaning that an earlier
534+
state doesn't reflect the data read by Read\ :sub:`1`).
530535

531536
* - |xmark| Monotonic writes
532537

@@ -536,8 +541,9 @@ some situations, but not necessarily in all situations.
536541
* - |xmark| Write follow read
537542

538543
- Write\ :sub:`2` updates data on ``P``\ :sub:`new` that does
539-
not reflect a state after Read\ :sub:`1` (i.e. an earlier
540-
state does not reflect the data read by Read\ :sub:`1`).
544+
not reflect a state after Read\ :sub:`1` (meaning that an
545+
earlier state doesn't reflect the data read by Read\
546+
:sub:`1`).
541547

542548
.. _causal-rc-local-wc-majority:
543549

@@ -589,14 +595,14 @@ some situations, but not necessarily in all situations.
589595

590596
* - |xmark| Read own writes.
591597

592-
- Read\ :sub:`1` reads data from ``S``\ :sub:`1` that does not
598+
- Read\ :sub:`1` reads data from ``S``\ :sub:`1` that doesn't
593599
reflect a state after Write1\ :sub:`1`.
594600

595601
* - |xmark| Monotonic reads.
596602

597-
- Read\ :sub:`2` reads data from ``S``\ :sub:`3` that does not
598-
reflect a state after Read\ :sub:`1` (i.e. an earlier state
599-
does not reflect the data read by Read\ :sub:`1`).
603+
- Read\ :sub:`2` reads data from ``S``\ :sub:`3` that doesn't
604+
reflect a state after Read\ :sub:`1` (meaning that an earlier
605+
state doesn't reflect the data read by Read\ :sub:`1`).
600606

601607
* - |checkmark| Monotonic writes
602608

@@ -606,8 +612,9 @@ some situations, but not necessarily in all situations.
606612
* - |xmark| Write follow read.
607613

608614
- Write\ :sub:`2` updates data on ``P``\ :sub:`new` that does
609-
not reflect a state after Read\ :sub:`1` (i.e. an earlier
610-
state does not reflect the data read by Read\ :sub:`1`).
615+
not reflect a state after Read\ :sub:`1` (meaning that an
616+
earlier state doesn't reflect the data read by Read\
617+
:sub:`1`).
611618

612619

613620
.. |arrow| unicode:: U+27A4

0 commit comments

Comments
 (0)