[CDRIVER-1136] Server Selection Spec for mongoc_database_command_simple Created: 23/Feb/16  Updated: 03/Jan/18  Resolved: 03/Mar/16

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

Type: Improvement 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
is related to CDRIVER-807 Remove secondary-ok commands whitelist Closed
Case:
Backwards Compatibility: Major Change

 Description   

mongoc_database_command_simple shouldn't use the database's read prefs if no prefs are provided in the parameter.

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.

If an explicit read preference argument is provided as part of the generic command method call, it MUST be used for server selection, regardless of the name of the command. It is up to the user to use an appropriate read preference, e.g. not calling renameCollection with a mode of 'secondary'.

https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.rst#use-of-read-preferences-with-commands



 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 NEWS entry about commands and read prefs
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/52161af7a7479c8e536bd46cc5263676d97cf4f3

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:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.