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

count helper doesn't apply read preference

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.2.6, 3.3.0
    • Component/s: Shell
    • Labels:
    • Environment:
      Debian 7
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      Linux
    • Backport Completed:
    • Steps To Reproduce:
      Hide

      mongo XXX.XXX.XXX.XXX:XXXX
      db.getMongo().setReadPref('secondary');
      use XXXX;
      db.getMongo().setReadPref('secondary');
      db.XXX.find().count();

      Show
      mongo XXX.XXX.XXX.XXX:XXXX db.getMongo().setReadPref('secondary'); use XXXX; db.getMongo().setReadPref('secondary'); db.XXX.find().count();

      Description

      I setup a v3.2 mongos with 3 shards and 3 replica for each shard.

      But from shell, no matter I set readpref to 'secondary' or 'secondarypreferred', my query always go to primary.

      I haven't tried other api like java, etc.

      By the way, when I miss-spell the mode, it doesn't tell me an error.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: