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

IndexError on lagging replica sets with read_preference = Secondary/SecondaryPreferred

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 2.4.2
    • Component/s: None
    • None

        File "/usr/local/python/env/prod_live/lib/python2.6/site-packages/pymongo/collection.py", line 598, in find_one
        File "/usr/local/python/env/prod_live/lib/python2.6/site-packages/pymongo/cursor.py", line 814, in next
          if len(self.__data) or self._refresh():
        File "/usr/local/python/env/prod_live/lib/python2.6/site-packages/pymongo/cursor.py", line 763, in _refresh
          self.__uuid_subtype))
        File "/usr/local/python/env/prod_live/lib/python2.6/site-packages/pymongo/cursor.py", line 700, in __send_message
          **kwargs)
        File "/usr/local/python/env/prod_live/lib/python2.6/site-packages/pymongo/mongo_replica_set_client.py", line 1203, in _send_message_with_response
          latency=secondary_acceptable_latency_ms)    
        File "/usr/local/python/env/prod_live/lib/python2.6/site-packages/pymongo/read_preferences.py", line 170, in select_member
          members, SECONDARY, tag_sets, latency)
        File "/usr/local/python/env/prod_live/lib/python2.6/site-packages/pymongo/read_preferences.py", line 162, in select_member
          candidate = select_member_with_tags(members, tags, True, latency)
        File "/usr/local/python/env/prod_live/lib/python2.6/site-packages/pymongo/read_preferences.py", line 127, in select_member_with_tags
          return random.choice(near_candidates)
        File "/usr/local/python/lib/python2.6/random.py", line 261, in choice
          return seq[int(self.random() * len(seq))]  # raises IndexError if seq is empty
      

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            semarj@gmail.com Joshua Semar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: