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

ReadPreference.NEAREST can route operations to arbiters in PyMongo 3.0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.0, 3.0.1
    • 3.0.2
    • None
    • ubuntu 14.04, mongodb=3.0.2, pymongo=3.0.1

    Description

      Setup is 3 node replica-set consisting of
      1 Primary, 1 Secondary, 1 Arbiter.

      Setting `w=2` and `read_preference=pymongo.ReadPreference.NEAREST` results in getting wrong results to queries occasionally.

      See attached example program. Output from the program on my system is:

      python pymongo_bug.py
      found 1 docs
      found 0 docs WHICH IS WRONG
      found 0 docs WHICH IS WRONG
      found 4 docs
      found 0 docs WHICH IS WRONG
      found 6 docs
      found 7 docs
      ...

      Setting read_preference to Primary or Secondary solves the problem.

      Attachments

        Issue Links

          Activity

            People

              bernie@mongodb.com Bernie Hackett
              andersbennehag Anders Bennehag
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: