From ee1ef00e2aee6f25b75d156c24ce7f5aab4529a4 Mon Sep 17 00:00:00 2001 From: Aravinda VK Date: Fri, 6 Jun 2014 16:04:40 +0530 Subject: geo-rep: Making replica failover check interval configurable Replica failover check interval is hardcoded to 60 sec by default. Now this option is made configurable and defaulted to 1 sec. To change the default value gluster volume geo-replication \ :: config replica_failover_interval 15 Change-Id: Iada1b80d510452dcfedebd8a21bebd62394b0597 BUG: 1066410 Signed-off-by: Aravinda VK Reviewed-on: http://review.gluster.org/8003 Reviewed-by: Venky Shankar Tested-by: Gluster Build System Tested-by: Venky Shankar --- geo-replication/syncdaemon/gsyncd.py | 2 ++ geo-replication/syncdaemon/master.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/geo-replication/syncdaemon/gsyncd.py b/geo-replication/syncdaemon/gsyncd.py index b307b87ae14..cb29903bf4f 100644 --- a/geo-replication/syncdaemon/gsyncd.py +++ b/geo-replication/syncdaemon/gsyncd.py @@ -250,6 +250,8 @@ def main_i(): op.add_option('--connection-timeout', metavar='SEC', type=int, default=60, help=SUPPRESS_HELP) op.add_option('--sync-jobs', metavar='N', type=int, default=3) + op.add_option('--replica-failover-interval', metavar='N', + type=int, default=1) op.add_option( '--turns', metavar='N', type=int, default=0, help=SUPPRESS_HELP) op.add_option('--allow-network', metavar='IPS', default='') diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py index 94c58bb3c9d..645f77524f0 100644 --- a/geo-replication/syncdaemon/master.py +++ b/geo-replication/syncdaemon/master.py @@ -478,7 +478,7 @@ class GMasterCommon(object): turns=self.turns, time=self.start) t1 = time.time() - if int(t1 - t0) >= 60: # lets hardcode this check to 60 seconds + if int(t1 - t0) >= int(gconf.replica_failover_interval): crawl = self.should_crawl() t0 = t1 self.update_worker_remote_node() -- cgit