Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #21 from drdk/bugfix_oplog_manager

Fixed oplog manager reconnect code for then the primary switches node.
  • Loading branch information...
commit a41383f464e48afca820723855bc603833f5bf62 2 parents a9cd05e + 9773e2c
@stbrody stbrody authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 mongo-connector/oplog_manager.py
View
6 mongo-connector/oplog_manager.py
@@ -88,7 +88,7 @@ def __init__(self, primary_conn, main_address, oplog_coll, is_sharded,
if auth_key is not None:
#Authenticate for the whole system
- primary_conn['admin'].authenticate(auth_username, auth_key)
+ self.primary_connection['admin'].authenticate(auth_username, auth_key)
self.main_connection['admin'].authenticate(auth_username, auth_key)
if self.oplog.find().count() == 0:
err_msg = 'OplogThread: No oplog for thread:'
@@ -110,7 +110,7 @@ def run(self):
continue
#The only entry is the last one we processed
- if util.retry_until_ok(cursor.count) == 1:
+ if cursor is None or util.retry_until_ok(cursor.count) == 1:
time.sleep(1)
continue
@@ -147,7 +147,7 @@ def run(self):
pass
if err is True and self.auth_key is not None:
- primary_conn['admin'].authenticate(self.auth_username, self.auth_key)
+ self.primary_connection['admin'].authenticate(self.auth_username, self.auth_key)
self.main_connection['admin'].authenticate(self.auth_username, self.auth_key)
err = False
Please sign in to comment.
Something went wrong with that request. Please try again.