-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 1.2-beta1
-
Component/s: libmongoc
-
None
For all read preferences modes except 'primary', clients MUST set the slaveOK wire protocol flag to ensure that any suitable server can handle the request. Clients MUST NOT set the slaveOK wire protocol flag if the read preference mode is 'primary'.
In this PR on the PHP driver, I have a test that sends a query to a secondary via mongoc_collection_find() where:
1. we forcefully set the cursor's hint to that secondary's server ID
2. we do not pass a read preference to mongoc_collection_find()
This triggers a "not master and slaveOk=false" error, which seems contrary to the SS spec.
As an aside: I think we could still trigger a "not master and slaveOk=false" error from the secondary if we passed a primary-only read preference to mongoc_collection_find() and still force the cursor hint.
- duplicates
-
CDRIVER-704 $readPreference sent to non-mongos
- Closed