[CDRIVER-1872] mongoc_cursor_set_hint causes secondary reads in sharded cluster Created: 20/Oct/16  Updated: 08/Nov/16  Resolved: 26/Oct/16

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: 1.4.0
Fix Version/s: 1.5.0

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-1885 Hinted cursors should not set slaveOk... Closed
is related to CDRIVER-903 slaveOk bit not set when using hint t... Closed
is related to CDRIVER-1188 Implement mongoc_cursor_set_hint() Closed

 Description   

Calling mongoc_cursor_set_hint (CDRIVER-1188) automatically sets the SlaveOkay bit. Normally this is correct since we intend to directly query a server, but via mongos setting SlaveOkay is equivalent to read preference "secondaryPreferred".



 Comments   
Comment by Githook User [ 08/Nov/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1872 fix mongos cursor_set_hint logic
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/168abfd2742f16bb1036199a56e521ba5334b04b

Comment by Githook User [ 25/Oct/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1872 don't use slaveok with mongos after mongoc_cursor_set_hint
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/96fed722bd1313b7c8c1ef2770eae09c9ce0b67b

Generated at Wed Feb 07 21:13:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.