Skip to content

Commit 3b32e73

Browse files
jason-price-mongodbjason-price-mongodb
and
jason-price-mongodb
authored
DOCSP-35091-majority-write-concern-updates (#5864) (#5963)
* DOCSP-35091-majority-write-concern-updates * DOCSP-35091-majority-write-concern-updates * DOCSP-35091-majority-write-concern-updates * DOCSP-35091-majority-write-concern-updates --------- Co-authored-by: jason-price-mongodb <[email protected]>
1 parent 5c4938e commit 3b32e73

File tree

1 file changed

+38
-34
lines changed

1 file changed

+38
-34
lines changed

source/core/transactions.txt

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ upper-right to set the language of the following example.
8080
/*
8181
For a replica set, include the replica set name and a seedlist of the members in the URI string; e.g.
8282
String uri = "mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017/admin?replicaSet=myRepl";
83-
For a sharded cluster, connect to the mongos instances; e.g.
83+
For a sharded cluster, connect to the mongos instances.
84+
For example:
8485
String uri = "mongodb://mongos0.example.com:27017,mongos1.example.com:27017:27017/admin";
8586
*/
8687

@@ -277,7 +278,6 @@ upper-right to set the language of the following example.
277278
.. literalinclude:: /driver-examples/DocumentationTransactionsExampleSpec.scala
278279
:language: scala
279280

280-
281281
.. seealso::
282282

283283
For an example in :binary:`~bin.mongosh`, see
@@ -290,12 +290,12 @@ Transactions and Atomicity
290290

291291
.. include:: /includes/transactions/distributed-transaction-repl-shard-support.rst
292292

293-
Distributed transactions are atomic. They provide an "all-or-nothing"
294-
proposition:
293+
Distributed transactions are atomic:
294+
295+
- Transactions either apply all data changes or roll back the changes.
295296

296-
- When a transaction commits, all data changes made in the transaction
297-
are saved and visible outside the transaction. That is, a transaction
298-
will not commit some of its changes while rolling back others.
297+
- If a transaction commits, all data changes made in the transaction
298+
are saved and are visible outside of the transaction.
299299

300300
.. include:: /includes/extracts/transactions-committed-visibility.rst
301301

@@ -334,11 +334,11 @@ For a list of operations not supported in transactions, see
334334

335335
.. _transactions-create-collections-indexes:
336336

337-
Create Collections and Indexes In a Transaction
337+
Create Collections and Indexes in a Transaction
338338
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
339339

340-
You can perform the following operations inside of a :ref:`distributed
341-
transaction <transactions>` as long as the transaction is not a
340+
You can perform the following operations in a :ref:`distributed
341+
transaction <transactions>` if the transaction is not a
342342
cross-shard write transaction:
343343

344344
- Create collections.
@@ -352,11 +352,11 @@ When creating a collection inside a transaction:
352352
<transactions-operations-ddl-implicit>`, such as with:
353353

354354
- an :ref:`insert operation <transactions-operations-ddl-implicit>`
355-
against a non-existing collection, or
355+
for a non-existent collection, or
356356

357357
- an :ref:`update/findAndModify operation
358358
<transactions-operations-ddl-implicit>` with ``upsert: true``
359-
against a non-existing collection.
359+
for a non-existent collection.
360360

361361
- You can :ref:`explicitly create a collection
362362
<transactions-operations-ddl-explicit>` using the :dbcommand:`create`
@@ -366,7 +366,7 @@ When :ref:`creating an index inside a transaction
366366
<transactions-operations-ddl-explicit>` [#create-existing-index]_, the
367367
index to create must be on either:
368368

369-
- a non-existing collection. The collection is created as part of the
369+
- a non-existent collection. The collection is created as part of the
370370
operation.
371371

372372
- a new empty collection created earlier in the same transaction.
@@ -387,7 +387,10 @@ Restrictions
387387

388388
- For explicit creation of a collection or an index inside a
389389
transaction, the transaction read concern level must be
390-
:readconcern:`"local"`. Explicit creation is through:
390+
:readconcern:`"local"`.
391+
392+
To explicitly create collections and indexes, use the following
393+
commands and methods:
391394

392395
.. list-table::
393396
:header-rows: 1
@@ -444,10 +447,9 @@ Restricted Operations
444447
Transactions and Sessions
445448
-------------------------
446449

447-
- Transactions are associated with a session
450+
- Transactions are associated with a session.
448451

449-
- At any given time, you can have at most one open transaction for a
450-
session.
452+
- You can have at most one open transaction at a time for a session.
451453

452454
- When using the drivers, each operation in the transaction must be
453455
associated with the session. Refer to your driver specific
@@ -487,7 +489,7 @@ Transactions and Read Concern
487489
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
488490

489491
Operations in a transaction use the transaction-level :doc:`read
490-
concern </reference/read-concern>`. That is, any read concern set at
492+
concern </reference/read-concern>`. This means a read concern set at
491493
the collection and database level is ignored inside the transaction.
492494

493495
You can set the transaction-level :doc:`read concern
@@ -498,8 +500,8 @@ You can set the transaction-level :doc:`read concern
498500

499501
- If transaction-level and the session-level read concern are unset,
500502
the transaction-level read concern defaults to the client-level read
501-
concern. By default, client-level read concern is
502-
:readconcern:`"local"` for reads against the primary. See also:
503+
concern. By default, the client-level read concern is
504+
:readconcern:`"local"` for reads on the primary. See also:
503505

504506
- :ref:`transactions-read-preference`
505507
- :doc:`/reference/mongodb-defaults`
@@ -559,16 +561,16 @@ Transactions and Write Concern
559561

560562
Transactions use the transaction-level :doc:`write concern
561563
</reference/write-concern>` to commit the write operations. Write
562-
operations inside transactions must be issued without explicit write
564+
operations inside transactions must be run without an explicit write
563565
concern specification and use the default write concern. At commit
564-
time, the writes are then commited using the transaction-level write
566+
time, the writes committed using the transaction-level write
565567
concern.
566568

567569
.. tip::
568570

569-
Do not explicitly set the write concern for the individual write
571+
Don't explicitly set the write concern for the individual write
570572
operations inside a transaction. Setting write concerns for the
571-
individual write operations inside a transaction results in an error.
573+
individual write operations inside a transaction returns an error.
572574

573575
You can set the transaction-level :doc:`write concern
574576
</reference/write-concern>` at the transaction start:
@@ -621,9 +623,8 @@ values, including:
621623
`````````````````
622624

623625
- Write concern :writeconcern:`w: "majority" <"majority">` returns
624-
acknowledgement after the commit has been applied to a majority
625-
(M) of voting members, meaning the commit has been applied to the
626-
primary and (M-1) voting secondaries.
626+
acknowledgement after the commit has been applied to a majority of
627+
voting members.
627628

628629
- When you commit with :writeconcern:`w: "majority" <"majority">`
629630
write concern, transaction-level :readconcern:`"majority"` read
@@ -652,12 +653,15 @@ values, including:
652653
General Information
653654
-------------------
654655

656+
The following sections describe additional considerations for
657+
transactions.
658+
655659
Production Considerations
656660
~~~~~~~~~~~~~~~~~~~~~~~~~
657661

658-
For various production considerations with using transactions, see
662+
For transactions in production environments, see
659663
:ref:`production-considerations`. In addition, for sharded
660-
clusters, see also :ref:`production-considerations-sharded`.
664+
clusters, see :ref:`production-considerations-sharded`.
661665

662666
Arbiters
663667
~~~~~~~~
@@ -678,7 +682,7 @@ Shard Configuration Restriction
678682
Diagnostics
679683
~~~~~~~~~~~
680684

681-
MongoDB provides various transactions metrics:
685+
To obtain transaction status and metrics, use the following methods:
682686

683687
.. list-table::
684688
:widths: 40 60
@@ -719,9 +723,9 @@ MongoDB provides various transactions metrics:
719723

720724
* - :binary:`~bin.mongod` and :binary:`~bin.mongos` log messages
721725

722-
- Includes information on slow transactions, which are transactions
726+
- Includes information on slow transactions (which are transactions
723727
that exceed the :setting:`operationProfiling.slowOpThresholdMs`
724-
threshold) under the :data:`TXN` log component.
728+
threshold) in the :data:`TXN` log component.
725729

726730
.. _transactions-fcv:
727731

@@ -775,8 +779,8 @@ Starting in MongoDB 5.2 (and 5.0.4):
775779
:parameter:`metadataRefreshInTransactionMaxWaitBehindCritSecMS`
776780
parameter.
777781

778-
Additional Transactions Topics
779-
------------------------------
782+
Learn More
783+
----------
780784

781785
- :doc:`/core/transactions-in-applications`
782786
- :doc:`/core/transactions-production-consideration`

0 commit comments

Comments
 (0)