-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 2.4.1
-
Component/s: None
-
None
-
Environment:Ubuntu 12.04 64-bit
Python 2.7.3
During a resiliency test script for our mongodb replica set, the primary member was shut down as read queries were sent to the replica set through the MongoReplicaSetClient class by the find_one() function.
The following call was made that caused the error:
exclude = {'_id' : False} for _ in xrange(total_queries): query = {'number' : random.randint(0, MAX_COLLECTION_SIZE)} try: results = collection.find_one(query, fields=exclude)
here's the backtrace:
File "/usr/local/lib/python2.7/dist-packages/pymongo/collection.py", line 598, in find_one for result in self.find(spec_or_id, *args, **kwargs).limit(-1): File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 814, in next if len(self.__data) or self._refresh(): File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 763, in _refresh self.__uuid_subtype)) File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 700, in __send_message **kwargs) File "/usr/local/lib/python2.7/dist-packages/pymongo/mongo_replica_set_client.py", line 1120, in _send_message_with_response self.__find_primary() File "/usr/local/lib/python2.7/dist-packages/pymongo/mongo_replica_set_client.py", line 858, in __find_primary primary = self.__members[self.__writer] KeyError: (u'10.12.30.86', 27017)
- is duplicated by
-
PYTHON-481 IndexError on lagging replica sets with read_preference = Secondary/SecondaryPreferred
- Closed