[CDRIVER-608] Read preference should be validated before server selection Created: 07/Apr/15  Updated: 19/Oct/16  Resolved: 22/Jun/16

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 1.1.4
Fix Version/s: 1.5.0

Type: Bug Priority: Major - P3
Reporter: Jeremy Mikola Assignee: Fiona Rowan
Resolution: Done Votes: 0
Labels: intern2016
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-598 Read preference tags are not validate... Closed

 Description   

From this comment on the PR for CDRIVER-590:

Previously, such a URI would result in the client's read preference having tags with the primary mode, which is invalid according to the read preference spec and mongoc_read_prefs_is_valid(). That said, mongoc_read_prefs_is_valid() was never actually called anywhere, so I'm not sure how libmongoc handled such a structure.

So, although mongoc_read_prefs_is_valid() exists, it's never called anywhere (apart from the URI validation added in CDRIVER-590). If we compare this to write concerns, those are checked before any write operation and can yield an error before we send anything to the server. I expect any read operation using a read preference should do the same and yield an error before attempting server selection.



 Comments   
Comment by Githook User [ 22/Jun/16 ]

Author:

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

Message: Merge pull request #340 from fionaRowan/C-608

CDRIVER-608 validate mongoc_read_prefs_t's
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/042833bf9605758c53a72b40011bd26e2893f9ff

Comment by Githook User [ 22/Jun/16 ]

Author:

{u'name': u'Fiona Rowan', u'email': u'fiona.rowan@10gen.com'}

Message: CDRIVER-608 validate mongoc_read_prefs_t's
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/29bef1aa57f98c411810949d172a333c207cf817

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