[DRIVERS-2160] Read preference behavior for RunCommand in a transaction Created: 29/May/19  Updated: 31/Mar/22

Status: Backlog
Project: Drivers
Component/s: Transactions
Fix Version/s: None

Type: Spec Change Priority: Major - P3
Reporter: Divjot Arora (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Driver Changes: Needed

 Description   

The transactions spec has the following rules for read preferences and runCommand in a transaction:
1. Note that the readPreference property is optional. The default value is NULL. If readPreference is NULL the value will be inherited from this session’s defaultTransactionOptions. If defaultTransactionOptions itself is NULL or the readPreference in defaultTransactionOptions is NULL, the readPreference is inherited from the MongoClient associated with this session.
2. The transaction’s read preference MUST override all other user configurable read preferences, with the exception of drivers that allow an operation level read preference. In this case, the driver MUST respect the read preference specified by the user, allowing the server to report an error.
3. The RunCommand method is considered a read operation and MUST use the transaction’s read preference.

Points 2 and 3 cause an issue for the "run command fails with explicit secondary read preference" for drivers that allow specifying a read preference for runCommand. If 2 is followed, the test passes but if 3 is followed, the operation will default to the client's read preference (primary) and there will be no error.


Generated at Thu Feb 08 08:24:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.