File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -232,8 +232,6 @@ with client.start_session() as s:
232
232
coll.find_one(session = s) # Error: "read preference in a transaction must be primary"
233
233
```
234
234
235
- In the future, we might relax this restriction and allow any read preference on a transaction.
236
-
237
235
#### maxCommitTimeMS
238
236
239
237
NOTE: This option is deprecated in favor of
@@ -926,6 +924,11 @@ won't be possible in the future for startTransaction to check that the read pref
926
924
application will perform in the transaction. Therefore, we specify now that the readPreference must be checked
927
925
per-operation. (However, we have not completely planned how read preference validation will behave in MongoDB 4.2.)
928
926
927
+ * Update 28.Oct.20214*
928
+
929
+ Note this section is retained in the spec for historical reasons and that the read preference in transactions must
930
+ always be primary.
931
+
929
932
### Users cannot pass readConcern or writeConcern to operations in transactions
930
933
931
934
For drivers that allow readConcern and/or writeConcern to be passed to a particular operation, If the driver did not
@@ -1070,6 +1073,8 @@ objective of avoiding duplicate commits.
1070
1073
1071
1074
## ** Changelog**
1072
1075
1076
+ - 2024-10-28: Note read preference must always be primary in a transaction.
1077
+
1073
1078
- 2024-05-08: Add bulkWrite to the list of commands allowed in transactions.
1074
1079
1075
1080
- 2024-02-15: Migrated from reStructuredText to Markdown.
You can’t perform that action at this time.
0 commit comments