@@ -64,10 +64,7 @@ string error labels. Drivers may also add error labels to errors that they retur
64
64
65
65
#### Transient Transaction Error
66
66
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.
71
68
72
69
### ** Naming variations**
73
70
@@ -675,12 +672,14 @@ contents of the document.
675
672
Starting in MongoDB 4.0, any command error may include a top level "errorLabels" field. The field contains an array of
676
673
string error labels.
677
674
678
- ### TransientTransactionError
675
+ ### Transient Transaction Error
679
676
680
677
Any command error that includes the "TransientTransactionError" error label in the "errorLabels" field. Any network
681
678
error or server selection error encountered running any command besides commitTransaction in a transaction. In the case
682
679
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.
684
683
685
684
#### Retrying transactions that fail with TransientTransactionError
686
685
@@ -1073,6 +1072,9 @@ objective of avoiding duplicate commits.
1073
1072
1074
1073
## ** Changelog**
1075
1074
1075
+
1076
+ - 2024-10-28: Clarify when drivers must add TransientTransactionError label.
1077
+
1076
1078
- 2024-10-28: Note read preference must always be primary in a transaction.
1077
1079
1078
1080
- 2024-05-08: Add bulkWrite to the list of commands allowed in transactions.
0 commit comments