-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.1.1
-
Component/s: Internal Client, Sharding
-
None
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.
- is duplicated by
-
SERVER-7868 Map/Reduce Does not run on secondaries in a sharded/replica-set configuration
- Closed
-
SERVER-7876 Counts running against secondaries with ReadPreference of PrimaryPreferred
- Closed
- is related to
-
SERVER-23427 Add test to ensure that read-only operations against the config db continue to work if the config server primary is unreachable from mongos
- Closed
-
SERVER-5525 mongos should send inline mapreduce with slaveOk to secondaries
- Closed
- related to
-
SERVER-4464 drivers and mongos should support 5 read preferences
- Closed