Skip to content

Commit 64099ca

Browse files
author
Dave Cuthbert
authored
DOCS-15386 BACKPORT (#1997)
* DOCS-15386 server parameter update (#1987) * DOCS-15386 server parameter update * Staging updates * Staging updates * Staging updates * Review feedback * Review feedback * Review feedback * DOCS-15386 BACKPORT * DOCS-15386 BACKPORT * DOCS-15386 BACKPORT * DOCS-15386 BACKPORT * DOCS-15386 BACKPORT
1 parent 48d6098 commit 64099ca

File tree

4 files changed

+57
-20
lines changed

4 files changed

+57
-20
lines changed

source/core/sharded-cluster-shards.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _shards-concepts:
2+
13
======
24
Shards
35
======
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
Starting in MongoDB 5.0, the new server parameter
1+
The server parameter
22
:parameter:`coordinateCommitReturnImmediatelyAfterPersistingDecision`
33
controls when transaction commit decisions are returned to the client.
4-
In previous versions of MongoDB, the :doc:`shard
5-
</core/sharded-cluster-shards>` transaction coordinator waited for all
6-
members to acknowledge a :ref:`multi-document transaction
4+
5+
The parameter was introduced in MongDB 5.0 with a default value of
6+
``true``. In MongoDB 5.0.10 the default value changes to ``false``.
7+
8+
When ``coordinateCommitReturnImmediatelyAfterPersistingDecision`` is
9+
``false``, the :ref:`shard <shards-concepts>` transaction coordinator
10+
waits for all members to acknowledge a :ref:`multi-document transaction
711
<transactions-atomicity>` commit before returning the commit decision to
812
the client.

source/reference/parameters.txt

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4337,42 +4337,64 @@ Transaction Parameters
43374337

43384338
.. parameter:: coordinateCommitReturnImmediatelyAfterPersistingDecision
43394339

4340-
.. versionadded:: 5.0
4340+
.. versionadded:: 5.0
4341+
4342+
*Updated in version 5.0.10*
43414343

43424344
*Type*: boolean
43434345

4344-
*Default*: true
4346+
*Default*: false
43454347

43464348
|mongod-only|
43474349

4348-
If ``true``, the :doc:`shard </core/sharded-cluster-shards>`
4349-
transaction coordinator returns a :ref:`multi-document transaction
4350-
<transactions-atomicity>` commit decision to the client as soon as
4351-
the commit is made :term:`durable` with the requested transaction
4352-
:doc:`write concern </reference/write-concern>`. If the client
4353-
requested a write concern that is less than
4350+
Behavior When ``false``
4351+
```````````````````````
4352+
4353+
The :ref:`shard <shards-concepts>` transaction coordinator waits for
4354+
all members to acknowledge the decision to either commit or cancel a
4355+
:ref:`multi-document transaction <transactions-atomicity>` before
4356+
returning the result to the client.
4357+
4358+
Behavior When ``true``
4359+
``````````````````````
4360+
4361+
The shard transaction coordinator returns a :ref:`multi-document
4362+
transaction <transactions-atomicity>` commit decision to the client
4363+
as soon as the decision is made :term:`durable` with the requested
4364+
transaction :ref:`write concern <write-concern>`.
4365+
4366+
If the client requested a write concern that is less than
43544367
:writeconcern:`"majority"`, the commit may roll back after the
43554368
decision is returned to the client.
43564369

4357-
If ``false``, the :doc:`shard </core/sharded-cluster-shards>`
4358-
transaction coordinator waits for all members to acknowledge a
4359-
:ref:`multi-document transaction <transactions-atomicity>` commit
4360-
before returning the commit decision to the client.
4370+
Transactions may not have "read your writes" consistency. That is, a
4371+
read operation may not reflect the results of a write operation that
4372+
preceded it. This can happen in the following cases:
4373+
4374+
- A transaction has to write to multiple shards.
4375+
- The read and the earlier write take place in different sessions.
4376+
4377+
:ref:`Causal consistency <causal-consistency>` only guarantees the
4378+
causal relationship of reads and writes that occurr within the same
4379+
session.
4380+
4381+
Example
4382+
```````
43614383

43624384
The following example sets
4363-
:parameter:`coordinateCommitReturnImmediatelyAfterPersistingDecision`
4364-
to ``false``:
4385+
``coordinateCommitReturnImmediatelyAfterPersistingDecision`` to
4386+
``true``:
43654387

43664388
.. code-block:: javascript
43674389

4368-
mongod --setParameter coordinateCommitReturnImmediatelyAfterPersistingDecision=false
4390+
mongod --setParameter coordinateCommitReturnImmediatelyAfterPersistingDecision=true
43694391

43704392
During runtime, you can also set the parameter with the
43714393
:dbcommand:`setParameter` command:
43724394

43734395
.. code-block:: bash
43744396

4375-
db.adminCommand( { setParameter: 1, coordinateCommitReturnImmediatelyAfterPersistingDecision: false } )
4397+
db.adminCommand( { setParameter: 1, coordinateCommitReturnImmediatelyAfterPersistingDecision: true } )
43764398

43774399
.. parameter:: transactionLifetimeLimitSeconds
43784400

source/release-notes/5.0-compatibility.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,3 +546,12 @@ features include:
546546

547547
- :ref:`Resharding a collection <sharding-resharding>` requires fCV set
548548
to 5.0+.
549+
550+
551+
Server Parameters
552+
-----------------
553+
554+
Starting in MongoDB 5.0.10 the default value for
555+
:parameter:`coordinateCommitReturnImmediatelyAfterPersistingDecision` is
556+
``false``.
557+

0 commit comments

Comments
 (0)