Skip to content

Commit 7b7bc2b

Browse files
jason-price-mongodbjason-price-mongodb
andauthored
DOCSP-35091-majority-write-concern-updates (#5864) (#5968)
* 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 <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
1 parent b894bff commit 7b7bc2b

File tree

1 file changed

+36
-32
lines changed

1 file changed

+36
-32
lines changed

source/core/transactions.txt

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ This example highlights the key components of the transactions API.
8383
/*
8484
For a replica set, include the replica set name and a seedlist of the members in the URI string; e.g.
8585
String uri = "mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017/admin?replicaSet=myRepl";
86-
For a sharded cluster, connect to the mongos instances; e.g.
86+
For a sharded cluster, connect to the mongos instances.
87+
For example:
8788
String uri = "mongodb://mongos0.example.com:27017,mongos1.example.com:27017:27017/admin";
8889
*/
8990

@@ -323,7 +324,6 @@ This example highlights the key components of the transactions API.
323324
.. literalinclude:: /driver-examples/DocumentationTransactionsExampleSpec.scala
324325
:language: scala
325326

326-
327327
.. seealso::
328328

329329
For an example in :binary:`~bin.mongosh`, see
@@ -336,12 +336,12 @@ Transactions and Atomicity
336336

337337
.. include:: /includes/transactions/distributed-transaction-repl-shard-support.rst
338338

339-
Distributed transactions are atomic. They provide an "all-or-nothing"
340-
proposition:
339+
Distributed transactions are atomic:
340+
341+
- Transactions either apply all data changes or roll back the changes.
341342

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

346346
.. include:: /includes/extracts/transactions-committed-visibility.rst
347347

@@ -380,11 +380,11 @@ For a list of operations not supported in transactions, see
380380

381381
.. _transactions-create-collections-indexes:
382382

383-
Create Collections and Indexes In a Transaction
383+
Create Collections and Indexes in a Transaction
384384
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
385385

386-
You can perform the following operations inside of a :ref:`distributed
387-
transaction <transactions>` as long as the transaction is not a
386+
You can perform the following operations in a :ref:`distributed
387+
transaction <transactions>` if the transaction is not a
388388
cross-shard write transaction:
389389

390390
- Create collections.
@@ -398,11 +398,11 @@ When creating a collection inside a transaction:
398398
<transactions-operations-ddl-implicit>`, such as with:
399399

400400
- an :ref:`insert operation <transactions-operations-ddl-implicit>`
401-
against a non-existing collection, or
401+
for a non-existent collection, or
402402

403403
- an :ref:`update/findAndModify operation
404404
<transactions-operations-ddl-implicit>` with ``upsert: true``
405-
against a non-existing collection.
405+
for a non-existent collection.
406406

407407
- You can :ref:`explicitly create a collection
408408
<transactions-operations-ddl-explicit>` using the :dbcommand:`create`
@@ -412,7 +412,7 @@ When :ref:`creating an index inside a transaction
412412
<transactions-operations-ddl-explicit>` [#create-existing-index]_, the
413413
index to create must be on either:
414414

415-
- a non-existing collection. The collection is created as part of the
415+
- a non-existent collection. The collection is created as part of the
416416
operation.
417417

418418
- a new empty collection created earlier in the same transaction.
@@ -431,7 +431,10 @@ Restrictions
431431

432432
- For explicit creation of a collection or an index inside a
433433
transaction, the transaction read concern level must be
434-
:readconcern:`"local"`. Explicit creation is through:
434+
:readconcern:`"local"`.
435+
436+
To explicitly create collections and indexes, use the following
437+
commands and methods:
435438

436439
.. list-table::
437440
:header-rows: 1
@@ -488,10 +491,9 @@ Restricted Operations
488491
Transactions and Sessions
489492
-------------------------
490493

491-
- Transactions are associated with a session
494+
- Transactions are associated with a session.
492495

493-
- At any given time, you can have at most one open transaction for a
494-
session.
496+
- You can have at most one open transaction at a time for a session.
495497

496498
- When using the drivers, each operation in the transaction must be
497499
associated with the session. Refer to your driver specific
@@ -531,7 +533,7 @@ Transactions and Read Concern
531533
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
532534

533535
Operations in a transaction use the transaction-level :doc:`read
534-
concern </reference/read-concern>`. That is, any read concern set at
536+
concern </reference/read-concern>`. This means a read concern set at
535537
the collection and database level is ignored inside the transaction.
536538

537539
You can set the transaction-level :doc:`read concern
@@ -542,8 +544,8 @@ You can set the transaction-level :doc:`read concern
542544

543545
- If transaction-level and the session-level read concern are unset,
544546
the transaction-level read concern defaults to the client-level read
545-
concern. By default, client-level read concern is
546-
:readconcern:`"local"` for reads against the primary. See also:
547+
concern. By default, the client-level read concern is
548+
:readconcern:`"local"` for reads on the primary. See also:
547549

548550
- :ref:`transactions-read-preference`
549551
- :doc:`/reference/mongodb-defaults`
@@ -603,16 +605,16 @@ Transactions and Write Concern
603605

604606
Transactions use the transaction-level :doc:`write concern
605607
</reference/write-concern>` to commit the write operations. Write
606-
operations inside transactions must be issued without explicit write
608+
operations inside transactions must be run without an explicit write
607609
concern specification and use the default write concern. At commit
608-
time, the writes are then commited using the transaction-level write
610+
time, the writes committed using the transaction-level write
609611
concern.
610612

611613
.. tip::
612614

613-
Do not explicitly set the write concern for the individual write
615+
Don't explicitly set the write concern for the individual write
614616
operations inside a transaction. Setting write concerns for the
615-
individual write operations inside a transaction results in an error.
617+
individual write operations inside a transaction returns an error.
616618

617619
You can set the transaction-level :doc:`write concern
618620
</reference/write-concern>` at the transaction start:
@@ -665,9 +667,8 @@ values, including:
665667
`````````````````
666668

667669
- Write concern :writeconcern:`w: "majority" <"majority">` returns
668-
acknowledgement after the commit has been applied to a majority
669-
(M) of voting members, meaning the commit has been applied to the
670-
primary and (M-1) voting secondaries.
670+
acknowledgement after the commit has been applied to a majority of
671+
voting members.
671672

672673
- When you commit with :writeconcern:`w: "majority" <"majority">`
673674
write concern, transaction-level :readconcern:`"majority"` read
@@ -696,12 +697,15 @@ values, including:
696697
General Information
697698
-------------------
698699

700+
The following sections describe additional considerations for
701+
transactions.
702+
699703
Production Considerations
700704
~~~~~~~~~~~~~~~~~~~~~~~~~
701705

702-
For various production considerations with using transactions, see
706+
For transactions in production environments, see
703707
:ref:`production-considerations`. In addition, for sharded
704-
clusters, see also :ref:`production-considerations-sharded`.
708+
clusters, see :ref:`production-considerations-sharded`.
705709

706710
Arbiters
707711
~~~~~~~~
@@ -722,7 +726,7 @@ Shard Configuration Restriction
722726
Diagnostics
723727
~~~~~~~~~~~
724728

725-
MongoDB provides various transactions metrics:
729+
To obtain transaction status and metrics, use the following methods:
726730

727731
.. list-table::
728732
:widths: 40 60
@@ -763,9 +767,9 @@ MongoDB provides various transactions metrics:
763767

764768
* - :binary:`~bin.mongod` and :binary:`~bin.mongos` log messages
765769

766-
- Includes information on slow transactions, which are transactions
770+
- Includes information on slow transactions (which are transactions
767771
that exceed the :setting:`operationProfiling.slowOpThresholdMs`
768-
threshold) under the :data:`TXN` log component.
772+
threshold) in the :data:`TXN` log component.
769773

770774
.. _transactions-fcv:
771775

0 commit comments

Comments
 (0)