-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Docs
-
None
The documentation of mongoc_client_select_server claims that the read preference is inherited by the client if NULL:
prefs: An optional mongoc_read_prefs_t. If for_writes is true, prefs must be NULL. Otherwise, use prefs to customize server selection, or pass NULL to use the read preference configured on the client.
But the implemented behavior appears to default to primary (much like the generic command helpers like mongoc_client_command_simple ().
We should validate this behavior. The existing write concern / read concern / read preference inheritance tests (in test-mongoc-opts.c) do not test mongoc_client_select_server.
See this PR conversation for more context.
https://github.com/mongodb/mongo-php-driver/pull/1144#discussion_r448443865