Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-7423

Support commands for read preference

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.3.1
    • 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.

            Assignee:
            randolph@mongodb.com Randolph Tan
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: