Skip to content

(DOCSP-18316): Change implicit write concern example #5806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 28 additions & 15 deletions source/includes/5.0-default-wc.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Starting in MongoDB 5.0, the implicit default write concern is
Starting in MongoDB 5.0, the implicit default
:ref:`write concern <write-concern>` is
:writeconcern:`w: majority <"majority">`. However, special
considerations are made for deployments containing :ref:`arbiters
<replica-set-arbiter-configuration>`:
considerations are made for deployments containing
:ref:`arbiters <replica-set-arbiter-configuration>`:

- The voting majority of a replica set is 1 plus half the number of
voting members, rounded down. If the number of data-bearing voting
Expand Down Expand Up @@ -34,10 +35,10 @@ default write concerns:
- Majority of Voting Nodes
- Implicit Default Write Concern

* - 3
* - 2
- 1
- 4
- 3
- 2
- ``{ w: 1 }``

* - 4
Expand All @@ -46,14 +47,26 @@ default write concerns:
- 3
- ``{ w: "majority" }``

- The first example has 3 non-arbiters and 1 arbiter for a total of 4
voting nodes. The majority of voting nodes (1 plus half of 4) is 3.
The number of non-arbiters (3) is less than or equal to the majority
of voting nodes, resulting in an implicit write concern of
``{ w: 1 }``.
- In the first example:

- The second example has 4 non-arbiters and 1 arbiter for a total of 5
voting nodes. The majority of voting nodes (1 plus half of 5, rounded
down) is 3. The number of non-arbiters (4) is greater than the majority
of voting nodes, resulting in an implicit write concern of ``{ w:
"majority" }``.
- There are 2 non-arbiters and 1 arbiter for a total of 3 voting
nodes.

- The majority of voting nodes (1 plus half of 3, rounded
down) is 2.

- The number of non-arbiters (2) is equal to
the majority of voting nodes (2), resulting in an implicit write
concern of ``{ w: 1 }``.

- In the second example:

- There are 4 non-arbiters and 1 arbiter for a total of 5
voting nodes.

- The majority of voting nodes (1 plus half of 5, rounded
down) is 3.

- The number of non-arbiters (4) is greater than the majority
of voting nodes (3), resulting in an implicit write concern of
``{ w: "majority" }``.
28 changes: 14 additions & 14 deletions source/release-notes/5.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -667,20 +667,20 @@ Implicit Default Write Concern

.. include:: /includes/5.0-default-wc.rst

The ``{ w: "majority" }`` default :doc:`write concern
</reference/write-concern>` provides a stronger durability guarantee in
the event of an election, or if replica set members become unavailable.

The :writeconcern:`w: majority <"majority">` write concern may impact
performance since writes will only be acknowledged once a
:ref:`calculated majority <calculating-majority-count>` of replica set
members have executed and persisted the write to disk.

If your application relies on performance-sensitive writes, you can use
the :dbcommand:`setDefaultRWConcern` command to explicitly set the
default write concern for improved performance at the cost of data
durability guarantees. You can also set the write concern at the
individual operation level for performance-critical writes. See your
The :writeconcern:`{ w: "majority" } <"majority">` default
:doc:`write concern </reference/write-concern>` provides a stronger
durability guarantee in the event of an election, or if replica set
members become unavailable.

The :writeconcern:`{ w: "majority" } <"majority">` write concern may
impact performance since writes will only be acknowledged once a
:ref:`calculated majority <calculating-majority-count>` of replica set
members have executed and persisted the write to disk. If your
application relies on performance-sensitive writes, you can use the
:dbcommand:`setDefaultRWConcern` command to explicitly set the default
write concern for improved performance at the cost of data durability
guarantees. You can also set the write concern at the individual
operation level for performance-critical writes. See your
:driver:`driver documentation </>` for details.

``mongosShutdownTimeoutMillisForSignaledShutdown`` Parameter
Expand Down