From 21199aaeb272da4b7857351bb2aa51f36c7e22cd Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Sun, 19 Aug 2018 13:53:15 -0400 Subject: geo-rep: Cleanup unwanted code Cleanup the Active/Passive logging code which is redundant. With new status infra implmented, this is redundant as every status switch is logged by status infra. fixes: bz#1619027 Change-Id: I0a6644cb998f3520e62a5189f21e4d66acc0e7c5 Signed-off-by: Kotresh HR --- geo-replication/syncdaemon/master.py | 16 ---------------- geo-replication/syncdaemon/rconf.py | 6 ------ 2 files changed, 22 deletions(-) diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py index ac31e3fb81a..7985aac5439 100644 --- a/geo-replication/syncdaemon/master.py +++ b/geo-replication/syncdaemon/master.py @@ -448,18 +448,10 @@ class GMasterCommon(object): if rconf.mgmt_lock_fd: try: fcntl.lockf(rconf.mgmt_lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB) - if not rconf.active_earlier: - rconf.active_earlier = True - logging.info(lf("Got lock Becoming ACTIVE", - brick=rconf.args.local_path)) return True except: ex = sys.exc_info()[1] if isinstance(ex, IOError) and ex.errno in (EACCES, EAGAIN): - if not rconf.passive_earlier: - rconf.passive_earlier = True - logging.info(lf("Didn't get lock Becoming PASSIVE", - brick=rconf.local_path)) return False raise @@ -494,18 +486,10 @@ class GMasterCommon(object): ex = sys.exc_info()[1] if isinstance(ex, IOError) and ex.errno in (EACCES, EAGAIN): # cannot grab, it's taken - if not rconf.passive_earlier: - rconf.passive_earlier = True - logging.info(lf("Didn't get lock Becoming PASSIVE", - brick=rconf.args.local_path)) rconf.mgmt_lock_fd = fd return False raise - if not rconf.active_earlier: - rconf.active_earlier = True - logging.info(lf("Got lock Becoming ACTIVE", - brick=rconf.args.local_path)) return True def should_crawl(self): diff --git a/geo-replication/syncdaemon/rconf.py b/geo-replication/syncdaemon/rconf.py index ccac62c63a8..ff716ee4d6d 100644 --- a/geo-replication/syncdaemon/rconf.py +++ b/geo-replication/syncdaemon/rconf.py @@ -21,12 +21,6 @@ class RConf(object): log_exit = False permanent_handles = [] log_metadata = {} - """One variable is sufficient to track the - switching of worker to ACTIVE. Two variables - are intentionally used to track worker going - to PASSIVE as well mainly for debugging""" - active_earlier = False - passive_earlier = False mgmt_lock_fd = None args = None turns = 0 -- cgit