@@ -4743,42 +4743,64 @@ Transaction Parameters
4743
4743
4744
4744
.. parameter:: coordinateCommitReturnImmediatelyAfterPersistingDecision
4745
4745
4746
- .. versionadded:: 5.0
4746
+ .. versionadded:: 5.0
4747
+
4748
+ *Updated in version 6.1*
4747
4749
4748
4750
*Type*: boolean
4749
4751
4750
- *Default*: true
4752
+ *Default*: false
4751
4753
4752
4754
|mongod-only|
4753
4755
4754
- If ``true``, the :doc:`shard </core/sharded-cluster-shards>`
4755
- transaction coordinator returns a :ref:`multi-document transaction
4756
- <transactions-atomicity>` commit decision to the client as soon as
4757
- the commit is made :term:`durable` with the requested transaction
4758
- :doc:`write concern </reference/write-concern>`. If the client
4759
- requested a write concern that is less than
4756
+ Behavior When ``false``
4757
+ ```````````````````````
4758
+
4759
+ The :ref:`shard <shards-concepts>` transaction coordinator waits for
4760
+ all members to acknowledge the decision to either commit or cancel a
4761
+ :ref:`multi-document transaction <transactions-atomicity>` before
4762
+ returning the result to the client.
4763
+
4764
+ Behavior When ``true``
4765
+ ``````````````````````
4766
+
4767
+ The shard transaction coordinator returns a :ref:`multi-document
4768
+ transaction <transactions-atomicity>` commit decision to the client
4769
+ as soon as the decision is made :term:`durable` with the requested
4770
+ transaction :ref:`write concern <write-concern>`.
4771
+
4772
+ If the client requested a write concern that is less than
4760
4773
:writeconcern:`"majority"`, the commit may roll back after the
4761
4774
decision is returned to the client.
4762
4775
4763
- If ``false``, the :doc:`shard </core/sharded-cluster-shards>`
4764
- transaction coordinator waits for all members to acknowledge a
4765
- :ref:`multi-document transaction <transactions-atomicity>` commit
4766
- before returning the commit decision to the client.
4776
+ Transactions may not have "read your writes" consistency. That is, a
4777
+ read operation may not reflect the results of a write operation that
4778
+ preceded it. This can happen in the following cases:
4779
+
4780
+ - A transaction has to write to multiple shards.
4781
+ - The read and the earlier write take place in different sessions.
4782
+
4783
+ :ref:`Causal consistency <causal-consistency>` only guarantees the
4784
+ causal relationship of reads and writes that occurr within the same
4785
+ session.
4786
+
4787
+ Example
4788
+ ```````
4767
4789
4768
4790
The following example sets
4769
- :parameter:` coordinateCommitReturnImmediatelyAfterPersistingDecision`
4770
- to ``false ``:
4791
+ `` coordinateCommitReturnImmediatelyAfterPersistingDecision`` to
4792
+ ``true ``:
4771
4793
4772
4794
.. code-block:: javascript
4773
4795
4774
- mongod --setParameter coordinateCommitReturnImmediatelyAfterPersistingDecision=false
4796
+ mongod --setParameter coordinateCommitReturnImmediatelyAfterPersistingDecision=true
4775
4797
4776
4798
During runtime, you can also set the parameter with the
4777
4799
:dbcommand:`setParameter` command:
4778
4800
4779
4801
.. code-block:: bash
4780
4802
4781
- db.adminCommand( { setParameter: 1, coordinateCommitReturnImmediatelyAfterPersistingDecision: false } )
4803
+ db.adminCommand( { setParameter: 1, coordinateCommitReturnImmediatelyAfterPersistingDecision: true } )
4782
4804
4783
4805
.. parameter:: transactionLifetimeLimitSeconds
4784
4806
0 commit comments