Skip to content

Commit d9ee02e

Browse files
DRIVERS-2084 Clarify TransientTransactionError specification (#1685)
Co-authored-by: Durran Jordan <[email protected]>
1 parent d2a8977 commit d9ee02e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

source/transactions/transactions.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@ string error labels. Drivers may also add error labels to errors that they retur
6464

6565
#### Transient Transaction Error
6666

67-
Any command error that includes the "TransientTransactionError" error label in the "errorLabels" field. Any network
68-
error encountered running any command other than commitTransaction in a transaction. If a network error occurs while
69-
running the commitTransaction command then it is not known whether the transaction committed or not, and thus the
70-
"TransientTransactionError" label MUST NOT be added.
67+
Any command or network error that includes the "TransientTransactionError" error label in the "errorLabels" field.
7168

7269
### **Naming variations**
7370

@@ -675,12 +672,14 @@ contents of the document.
675672
Starting in MongoDB 4.0, any command error may include a top level "errorLabels" field. The field contains an array of
676673
string error labels.
677674

678-
### TransientTransactionError
675+
### Transient Transaction Error
679676

680677
Any command error that includes the "TransientTransactionError" error label in the "errorLabels" field. Any network
681678
error or server selection error encountered running any command besides commitTransaction in a transaction. In the case
682679
of command errors, the server adds the label; in the case of network errors or server selection errors where the client
683-
receives no server reply, the client adds the label.
680+
receives no server reply, the client MUST add the label. If a network error occurs while running the commitTransaction
681+
command then it is not known whether the transaction committed or not, and thus the "TransientTransactionError" label
682+
MUST NOT be added.
684683

685684
#### Retrying transactions that fail with TransientTransactionError
686685

@@ -1073,6 +1072,9 @@ objective of avoiding duplicate commits.
10731072

10741073
## **Changelog**
10751074

1075+
1076+
- 2024-10-28: Clarify when drivers must add TransientTransactionError label.
1077+
10761078
- 2024-10-28: Note read preference must always be primary in a transaction.
10771079

10781080
- 2024-05-08: Add bulkWrite to the list of commands allowed in transactions.

0 commit comments

Comments
 (0)