-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
None
-
Affects Version/s: 1.9.0
-
Component/s: libmongoc
-
None
In the OP_QUERY wire protocol we can directly connect to a secondary by setting the slaveOkay bit for all messages when TopologyType is Single. With OP_MSG there's no such bit, so reads are rejected with "not master and slaveOk=false".
Solution: include {$readPreference: "primaryPreferred"} with all messages if there's no read preference, the wire protocol is OP_MSG, and TopologyType is Single.
Refactor the existing code in mongoc-cursor.c and mongoc_collection_aggregate that does this especially for cursors with a serverId set.
- is related to
-
CDRIVER-2219 OP_MSG support
- Closed