[SERVER-7423] Support commands for read preference Created: 19/Oct/12  Updated: 11/Jul/16  Resolved: 19/Nov/12

Status: Closed
Project: Core Server
Component/s: Internal Client, Sharding
Affects Version/s: 2.1.1
Fix Version/s: 2.3.1

Type: New Feature Priority: Major - P3
Reporter: Randolph Tan Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by SERVER-7868 Map/Reduce Does not run on secondarie... Closed
is duplicated by SERVER-7876 Counts running against secondaries wi... Closed
Related
related to DOCS-826 Document about mongos support for com... Closed
related to SERVER-4464 drivers and mongos should support 5 r... Closed
is related to SERVER-23427 Add test to ensure that read-only ope... Closed
is related to SERVER-5525 mongos should send inline mapreduce w... Closed
Participants:

 Description   

The driver's generic command() or runCommand() API should accept a read preference, and obey the preference for these commands:

group
inline mapreduce
aggregate
collStats, dbStats
count, distinct
geoNear, geoSearch, geoWalk
For these exceptional commands, the driver or mongos obeys the read preference the same as for queries. Otherwise, all commands are run on the primary.

Note: In the future we'll need to add a field to commands in listCommands to distinguish new commands that should obey the read preference. The slaveOk field alone doesn't cover this: e.g., reindex has slaveOk true, but we've decided that reindex with a read preference of SECONDARY should not reindex a random secondary, it should be run on the primary.



 Comments   
Comment by auto [ 22/Jan/13 ]

Author:

{u'date': u'2013-01-22T19:02:27Z', u'email': u'jesse@10gen.com', u'name': u'A. Jesse Jiryu Davis'}

Message: SERVER-7423 more thorough testing of commands and read preferences on mongos
Branch: master
https://github.com/mongodb/mongo/commit/ffb455ab773816ba576099886192d3f379d4b1ae

Comment by auto [ 20/Nov/12 ]

Author:

{u'date': u'2012-11-20T16:04:20Z', u'email': u'randolph@10gen.com', u'name': u'Randolph Tan'}

Message: SERVER-7423 Support commands for read preference

Made sure that the drop command gets applied on the secondaries first before initializing the profile collections in the test.
Branch: master
https://github.com/mongodb/mongo/commit/7aac243b122f4ac073f81a1f98182d40bc322ffc

Comment by auto [ 19/Nov/12 ]

Author:

{u'date': u'2012-11-05T20:16:56Z', u'email': u'randolph@10gen.com', u'name': u'Randolph Tan'}

Message: SERVER-7423 Support commands for read preference

Step#2 Added mongos support.
Branch: master
https://github.com/mongodb/mongo/commit/6bdaca981be459757d6d93b5cc34724ff89359c6

Comment by auto [ 31/Oct/12 ]

Author:

{u'date': u'2012-10-16T19:21:17-07:00', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-7423 Support commands for read preference

Step#1 Add shell helper
Branch: master
https://github.com/mongodb/mongo/commit/44e2a3167adb48e9055639bbd9d94bd9c4d4460b

Generated at Thu Feb 08 03:14:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.