-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Query
-
None
-
Minor Change
It appears that the driver currently has the following behavior when in a direct connection (Single topology) to a secondary RS member:
- Server 2.6: slaveok=true is always added to the queries, even if user explicitly specified read preference: primary. These servers don't support $readPreference specification that OP_MSG supports hence the driver effectively changes the user's explicitly provided read preference, silently.
- Server 4.4: equivalent of slaveok=true is not added unless the user explicitly requested read preference: secondary or secondary preferred. Read queries fail unless read preference is explicitly given.
Per https://jira.mongodb.org/browse/DRIVERS-1191, the behavior for 2.6 servers is correct - read preference must be overwritten with primaryPreferred when in Single topology regardless of user input. This ticket covers changing 3.6+ servers to have this behavior.
- is depended on by
-
RUBY-2110 Examine features on connection rather than server in operations layer
- Closed
- links to