Skip to content

Commit d2a8977

Browse files
authored
chore(DRIVERS-2730): remove support for non primary read preference (#1684)
1 parent bc988bb commit d2a8977

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

source/transactions/transactions.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ with client.start_session() as s:
232232
coll.find_one(session=s) # Error: "read preference in a transaction must be primary"
233233
```
234234

235-
In the future, we might relax this restriction and allow any read preference on a transaction.
236-
237235
#### maxCommitTimeMS
238236

239237
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
926924
application will perform in the transaction. Therefore, we specify now that the readPreference must be checked
927925
per-operation. (However, we have not completely planned how read preference validation will behave in MongoDB 4.2.)
928926

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+
929932
### Users cannot pass readConcern or writeConcern to operations in transactions
930933

931934
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.
10701073

10711074
## **Changelog**
10721075

1076+
- 2024-10-28: Note read preference must always be primary in a transaction.
1077+
10731078
- 2024-05-08: Add bulkWrite to the list of commands allowed in transactions.
10741079

10751080
- 2024-02-15: Migrated from reStructuredText to Markdown.

0 commit comments

Comments
 (0)