Skip to content

Commit c0f4edf

Browse files
author
Dave Cuthbert
authored
DOCS-15386 BACKPORT (#1996)
* 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
1 parent 1f800d9 commit c0f4edf

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: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
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 6.0 and 5.0.10 the default value changes to
7+
``false``.
8+
9+
When ``coordinateCommitReturnImmediatelyAfterPersistingDecision`` is
10+
``false``, the :ref:`shard <shards-concepts>` transaction coordinator
11+
waits for all members to acknowledge a :ref:`multi-document transaction
712
<transactions-atomicity>` commit before returning the commit decision to
813
the client.

source/reference/parameters.txt

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

46744674
.. parameter:: coordinateCommitReturnImmediatelyAfterPersistingDecision
46754675

4676-
.. versionadded:: 5.0
4676+
.. versionadded:: 5.0
4677+
4678+
*Updated in version 6.0 and in 5.0.10*
46774679

46784680
*Type*: boolean
46794681

4680-
*Default*: true
4682+
*Default*: false
46814683

46824684
|mongod-only|
46834685

4684-
If ``true``, the :doc:`shard </core/sharded-cluster-shards>`
4685-
transaction coordinator returns a :ref:`multi-document transaction
4686-
<transactions-atomicity>` commit decision to the client as soon as
4687-
the commit is made :term:`durable` with the requested transaction
4688-
:doc:`write concern </reference/write-concern>`. If the client
4689-
requested a write concern that is less than
4686+
Behavior When ``false``
4687+
```````````````````````
4688+
4689+
The :ref:`shard <shards-concepts>` transaction coordinator waits for
4690+
all members to acknowledge the decision to either commit or cancel a
4691+
:ref:`multi-document transaction <transactions-atomicity>` before
4692+
returning the result to the client.
4693+
4694+
Behavior When ``true``
4695+
``````````````````````
4696+
4697+
The shard transaction coordinator returns a :ref:`multi-document
4698+
transaction <transactions-atomicity>` commit decision to the client
4699+
as soon as the decision is made :term:`durable` with the requested
4700+
transaction :ref:`write concern <write-concern>`.
4701+
4702+
If the client requested a write concern that is less than
46904703
:writeconcern:`"majority"`, the commit may roll back after the
46914704
decision is returned to the client.
46924705

4693-
If ``false``, the :doc:`shard </core/sharded-cluster-shards>`
4694-
transaction coordinator waits for all members to acknowledge a
4695-
:ref:`multi-document transaction <transactions-atomicity>` commit
4696-
before returning the commit decision to the client.
4706+
Transactions may not have "read your writes" consistency. That is, a
4707+
read operation may not reflect the results of a write operation that
4708+
preceded it. This can happen in the following cases:
4709+
4710+
- A transaction has to write to multiple shards.
4711+
- The read and the earlier write take place in different sessions.
4712+
4713+
:ref:`Causal consistency <causal-consistency>` only guarantees the
4714+
causal relationship of reads and writes that occurr within the same
4715+
session.
4716+
4717+
Example
4718+
```````
46974719

46984720
The following example sets
4699-
:parameter:`coordinateCommitReturnImmediatelyAfterPersistingDecision`
4700-
to ``false``:
4721+
``coordinateCommitReturnImmediatelyAfterPersistingDecision`` to
4722+
``true``:
47014723

47024724
.. code-block:: javascript
47034725

4704-
mongod --setParameter coordinateCommitReturnImmediatelyAfterPersistingDecision=false
4726+
mongod --setParameter coordinateCommitReturnImmediatelyAfterPersistingDecision=true
47054727

47064728
During runtime, you can also set the parameter with the
47074729
:dbcommand:`setParameter` command:
47084730

47094731
.. code-block:: bash
47104732

4711-
db.adminCommand( { setParameter: 1, coordinateCommitReturnImmediatelyAfterPersistingDecision: false } )
4733+
db.adminCommand( { setParameter: 1, coordinateCommitReturnImmediatelyAfterPersistingDecision: true } )
47124734

47134735
.. parameter:: transactionLifetimeLimitSeconds
47144736

source/release-notes/6.0-compatibility.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,3 +539,11 @@ Collections with Encrypted Fields
539539
You must drop collections that use encrypted fields before you
540540
can complete the FCV downgrade. The downgrade will not complete
541541
if there are collections using ``encryptedFields``.
542+
543+
Server Parameters
544+
-----------------
545+
546+
Starting in MongoDB 6.0 and 5.0.10 the default value for
547+
:parameter:`coordinateCommitReturnImmediatelyAfterPersistingDecision` is
548+
``false``.
549+

0 commit comments

Comments
 (0)