Skip to content

Sre 2645 added more loging #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mongodb_consistent_backup/Oplog/Resolver/Resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,7 @@ def run(self):
self.stopped = True

for shard in self.resolver_state:
logging.info("Getting shard oplog state %s" % (shard))
self.resolver_summary[shard] = self.resolver_state[shard].get()
logging.info("Returning self.resolver_summary")
return self.resolver_summary
3 changes: 2 additions & 1 deletion mongodb_consistent_backup/Oplog/Tailer/TailThread.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def status(self):

def connect(self):
if not self.db:
self.db = DB(self.uri, self.config, True, 'secondary', True)
self.db = DB(self.uri, self.config, False, 'secondary', True)
return self.db.connection()

def run(self):
Expand Down Expand Up @@ -169,6 +169,7 @@ def run(self):
self.stopped = True
self.state.set('running', False)
self.timer.stop(self.timer_name)
logging.info("Thread is stopped and marked as stopped %s" % self.uri)

if self.exit_code == 0:
log_msg_extra = "%i oplog changes" % self.count
Expand Down
4 changes: 2 additions & 2 deletions mongodb_consistent_backup/Oplog/Tailer/Tailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def stop(self, kill=False, sleep_secs=3):
logging.warning("Could not get current optime from PRIMARY! Using now as a stop time")
timestamp = Timestamp(int(time()), 0)

# wait for replication to get in sync
while state.get('last_ts') and state.get('last_ts') < timestamp:
# wait for replication to get in sync making sure cursor has not been stopped in a race condition
while state.get('last_ts') and state.get('last_ts') < timestamp and not self.shards[shard]['thread'].stopped:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the first condition is unnecessary if the second depends on it anyway.

logging.info('Waiting for %s tailer to reach ts: %s, currrent: %s' % (uri, timestamp, state.get('last_ts')))
sleep(sleep_secs)

Expand Down