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

Support commands for read preference

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.1.1
    • 2.3.1
    • Internal Client, Sharding
    • None

    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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: