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

count helper doesn't apply read preference

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.6, 3.3.0
    • Affects Version/s: 3.2.0
    • Component/s: Shell
    • Environment:
      Debian 7
    • Fully Compatible
    • Linux
    • 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();

      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.

            Assignee:
            adam.midvidy Adam Midvidy
            Reporter:
            Hoyt Ren Hoyt Ren
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: