@@ -4337,42 +4337,64 @@ Transaction Parameters
4337
4337
4338
4338
.. parameter:: coordinateCommitReturnImmediatelyAfterPersistingDecision
4339
4339
4340
- .. versionadded:: 5.0
4340
+ .. versionadded:: 5.0
4341
+
4342
+ *Updated in version 5.0.10*
4341
4343
4342
4344
*Type*: boolean
4343
4345
4344
- *Default*: true
4346
+ *Default*: false
4345
4347
4346
4348
|mongod-only|
4347
4349
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
4354
4367
:writeconcern:`"majority"`, the commit may roll back after the
4355
4368
decision is returned to the client.
4356
4369
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
+ ```````
4361
4383
4362
4384
The following example sets
4363
- :parameter:` coordinateCommitReturnImmediatelyAfterPersistingDecision`
4364
- to ``false ``:
4385
+ `` coordinateCommitReturnImmediatelyAfterPersistingDecision`` to
4386
+ ``true ``:
4365
4387
4366
4388
.. code-block:: javascript
4367
4389
4368
- mongod --setParameter coordinateCommitReturnImmediatelyAfterPersistingDecision=false
4390
+ mongod --setParameter coordinateCommitReturnImmediatelyAfterPersistingDecision=true
4369
4391
4370
4392
During runtime, you can also set the parameter with the
4371
4393
:dbcommand:`setParameter` command:
4372
4394
4373
4395
.. code-block:: bash
4374
4396
4375
- db.adminCommand( { setParameter: 1, coordinateCommitReturnImmediatelyAfterPersistingDecision: false } )
4397
+ db.adminCommand( { setParameter: 1, coordinateCommitReturnImmediatelyAfterPersistingDecision: true } )
4376
4398
4377
4399
.. parameter:: transactionLifetimeLimitSeconds
4378
4400
0 commit comments