Skip to content

Commit b34d30b

Browse files
authored
DOCS-5341 Clarify Replica Set Write Concern when w > 1 (#2620)
* DOCS-5341 Clarify Replica Set Write Concern when w > 1 * JA edits + try reformatting * adjust bullets * AK edits + JA nit * AK edits: more accurate language + clarify note on data-bearing members * formatting * typo fix
1 parent e0a0c3d commit b34d30b

File tree

2 files changed

+27
-28
lines changed

2 files changed

+27
-28
lines changed

source/core/replica-set-write-concern.txt

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,24 @@ operation returns as successful. A member can only acknowledge a
1919
write operation after it has received and applied the write
2020
successfully.
2121

22-
For replica sets, the write concern of
23-
:writeconcern:`w: "majority" <"majority">` requires acknowledgement that
24-
the write operations have propagated to a
25-
:ref:`calculated majority <calculating-majority-count>` of the
26-
data-bearing voting members. For most replica set configurations,
27-
:writeconcern:`w: "majority" <"majority">` is the default
28-
write concern. To learn how MongoDB determines the default write
29-
concern, see :ref:`wc-default-behavior`.
30-
31-
For clusters where members have :ref:`journaling <journaling-internals>`
32-
enabled, combining ``"majority"`` write concern with :writeconcern:`j :
33-
true <j>` can prevent :ref:`rollback <replica-set-rollbacks>` of write
34-
concern acknowledged data.
35-
36-
Write operations with a write concern of
37-
:writeconcern:`w: 1 <\<number\>>` require that only the primary replica
38-
set member acknowledge the write before returning write concern
39-
acknowledgment. You can specify an integer value greater than ``1`` to
40-
require acknowledgment from the primary and as many secondaries as
41-
needed to meet the specified value, up to the total number of
42-
data-bearing members in the replica set.
22+
For replica sets:
23+
24+
- A write concern of :writeconcern:`w: "majority" <"majority">` requires
25+
acknowledgement that the write operations have been durably committed to a
26+
:ref:`calculated majority <calculating-majority-count>` of the data-bearing
27+
voting members. For most replica set configurations, :writeconcern:`w:
28+
"majority" <"majority">` is the :ref:`default write concern
29+
<wc-default-behavior>`.
30+
31+
- A write concern of :writeconcern:`w: 1 <\<number\>>` only requires
32+
acknowledgment from the primary replica set member before returning
33+
write concern acknowledgment.
34+
35+
- A write concern with a numeric value greater than ``1`` requires
36+
acknowledgment from the primary and as many secondaries as needed to meet the
37+
specified value. The secondaries do not need to be voting members to meet the
38+
write concern threshold. The specified write concern value cannot be greater
39+
than the total number of data-bearing members in the replica set.
4340

4441
For complete documentation on write acknowledgment
4542
behavior, see :ref:`wc-ack-behavior`.

source/reference/write-concern.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ available:
7979

8080
* - .. writeconcern:: "majority"
8181

82-
- Requests acknowledgment that write operations have propagated to
83-
the :ref:`calculated majority <calculating-majority-count>` of
82+
- Requests acknowledgment that write operations have been durably committed
83+
to the :ref:`calculated majority <calculating-majority-count>` of
8484
the data-bearing voting members (i.e. primary and secondaries
8585
with :rsconf:`members[n].votes` greater than ``0``).
8686
``{ w: "majority" }`` is the default write concern for *most* MongoDB
@@ -143,11 +143,13 @@ available:
143143

144144
``w`` greater than 1 requires acknowledgment from the primary
145145
and as many data-bearing secondaries as needed to meet the
146-
specified write concern. For example, consider a 3-member
147-
replica set with a primary and 2 secondaries. Specifying ``w:
148-
2`` would require acknowledgment from the primary and one of the
149-
secondaries. Specifying ``w: 3`` would require acknowledgment
150-
from the primary and both secondaries.
146+
specified write concern. The secondaries do not need to be
147+
voting members to meet the write concern threshold.
148+
149+
For example, consider a 3-member replica set with a primary and 2
150+
secondaries. Specifying ``w: 2`` would require acknowledgment from the
151+
primary and one of the secondaries. Specifying ``w: 3`` would require
152+
acknowledgment from the primary and both secondaries.
151153

152154
.. note::
153155

0 commit comments

Comments
 (0)