-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
As noted in CDRIVER-2744:
I realize that it's a bit redundant for PHPLIB to add a read preference to a query if we're not communicating with mongos, since we would have already done server selection by this point. That is likely be something we can refactor independently of this issue.
Since PHPLIB executes its operations on a MongoDB\Driver\Server, it may be redundant to specify a "readPreference" option in commands and queries if we're not executing the operation on a mongos node.
The only edge case I can think of is whether secondaries still using OP_QUERY may still require a wire protocol bit set and whether libmongoc infers that from the read preference. According to the Server Selection spec, the bit should always be set when communicating with a mongod in standalone mode. We should confirm whether libmongoc will automatically set the bit if we're sending a command/query to a secondary after PHPLIB has performed its server selection in a replica set topology.
- is related to
-
CDRIVER-2744 _mongoc_cursor_new_with_opts() rejects primary read preference within transaction
- Closed
- links to