[CDRIVER-1127] mongoc_database_create_collection should set read prefs PRIMARY Created: 20/Feb/16  Updated: 03/Jan/18  Resolved: 25/Feb/16

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: 1.4.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:
Depends
Related
is related to CDRIVER-807 Remove secondary-ok commands whitelist Closed
Case:

 Description   

If mongoc_database_create_collection is called with a database whose read prefs are configured to something besides PRIMARY, the "create" command can be wrongly run on a secondary. This contradicts the Server Selection Spec.

Check for other command helpers with the same bug.



 Comments   
Comment by Githook User [ 24/Feb/16 ]

Author:

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

Message: CDRIVER-1136 db commands must ignore read pref

Server Selection Spec: "The generic command method has a default read
preference of mode 'primary'. The generic command method MUST ignore any
default read preference from client, database or collection configuration. The
generic command method SHOULD allow an optional read preference argument."

Also fixes CDRIVER-1127.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/8f709d6ee24ae1c8500e6a428d05a5e52a4aeb15

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