Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1091

Read preference being ignored

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Linux and OSX, in the latter python was builded from source.

      Hello,

      Perhaps I'm doing something wrong, but I can't get pymongo to respect the read preference.
      Here I show how it ignores the read preference = Secondary.
      However, in all the settings I tried it always connects to the Primary.
      Same thing happens with SecondaryPreferred and with Nearest, the ping difference, through MongoDB is quite significant.
      I have also asked the same question on mongo-user, just in case I'm being naive and missed out something trivial.

      Here it is in 3.2.2:
      https://gist.github.com/edgarcosta/9360ae676cfc929752c377ed4927e204

      Here it is in 2.8:
      https://gist.github.com/edgarcosta/96d33b7ee79b4b64ab1123d50c05da6b

      and here are the rs.conf():
      https://gist.github.com/edgarcosta/3799a85296e6ca288ecfa832c498dbba
      and
      rs.status():
      https://gist.github.com/edgarcosta/69a4f967dfb11971ecce7e23ce64229c

      Primary is running MongoDB 3.2.1 and the secondaries are running MongoDB 3.2.6.

      Best,
      Edgar

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            edgarcosta Edgar Costa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: