[CDRIVER-807] Remove secondary-ok commands whitelist Created: 15/Aug/15  Updated: 03/May/16  Resolved: 08/Oct/15

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: 1.3.0-beta0

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:
Depends
is depended on by CDRIVER-906 Separate command and query code Closed
Related
related to CDRIVER-1127 mongoc_database_create_collection sho... Closed
related to CDRIVER-1136 Server Selection Spec for mongoc_data... Closed
is related to CDRIVER-244 Log a warning when ignoring user-spec... Closed
is related to CDRIVER-1137 Server Selection Spec for "query-like... Closed

 Description   

With the new Server Selection Spec, there is no longer a list of "secondary-ok" commands, and commands not in that list, when executed with a non-"primary" read preference, are no longer silently routed to the primary. On the other hand, the read preference configured on the client, database, or collection object no longer applies to commands executed with a generic command helper:

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

https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.rst#general-command-method-going-to-primary

Delete gSecondaryOkCommands:

https://github.com/mongodb/mongo-c-driver/blob/0aa9addfd7fb572b93e0723d6c32370721a18d05/src/mongoc/mongoc-cursor.c#L159

... and review the functions mongoc_client_command, etc., for compliance with the spec.



 Comments   
Comment by Githook User [ 03/May/16 ]

Author:

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

Message: CDRIVER-807 docs for command funcs and read prefs
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/7aefffbdad9cf9cdbc9283c64e5f8b9a1ae54bf8

Comment by Githook User [ 08/Oct/15 ]

Author:

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

Message: CDRIVER-807 remove list of secondary-ok commands

All commands now obey read preference.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/973c0f0e24266e2bda66312c1b128c05ea0c93c9

Comment by A. Jesse Jiryu Davis [ 08/Sep/15 ]

Update here:

https://github.com/mongodb/mongo-c-driver/blob/1.2.0-beta1/src/mongoc/mongoc-cursor.c#L143

... and remove special-casing for aggregate with "$out" and mapreduce with "out".

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