@@ -4673,42 +4673,64 @@ Transaction Parameters
4673
4673
4674
4674
.. parameter:: coordinateCommitReturnImmediatelyAfterPersistingDecision
4675
4675
4676
- .. versionadded:: 5.0
4676
+ .. versionadded:: 5.0
4677
+
4678
+ *Updated in version 6.0 and in 5.0.10*
4677
4679
4678
4680
*Type*: boolean
4679
4681
4680
- *Default*: true
4682
+ *Default*: false
4681
4683
4682
4684
|mongod-only|
4683
4685
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
4690
4703
:writeconcern:`"majority"`, the commit may roll back after the
4691
4704
decision is returned to the client.
4692
4705
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
+ ```````
4697
4719
4698
4720
The following example sets
4699
- :parameter:` coordinateCommitReturnImmediatelyAfterPersistingDecision`
4700
- to ``false ``:
4721
+ `` coordinateCommitReturnImmediatelyAfterPersistingDecision`` to
4722
+ ``true ``:
4701
4723
4702
4724
.. code-block:: javascript
4703
4725
4704
- mongod --setParameter coordinateCommitReturnImmediatelyAfterPersistingDecision=false
4726
+ mongod --setParameter coordinateCommitReturnImmediatelyAfterPersistingDecision=true
4705
4727
4706
4728
During runtime, you can also set the parameter with the
4707
4729
:dbcommand:`setParameter` command:
4708
4730
4709
4731
.. code-block:: bash
4710
4732
4711
- db.adminCommand( { setParameter: 1, coordinateCommitReturnImmediatelyAfterPersistingDecision: false } )
4733
+ db.adminCommand( { setParameter: 1, coordinateCommitReturnImmediatelyAfterPersistingDecision: true } )
4712
4734
4713
4735
.. parameter:: transactionLifetimeLimitSeconds
4714
4736
0 commit comments