summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2014-06-06 16:04:40 +0530
committerVenky Shankar <vshankar@redhat.com>2014-06-11 23:55:31 -0700
commitee1ef00e2aee6f25b75d156c24ce7f5aab4529a4 (patch)
tree5e4fd3f6c1913024100b4ba00275d9fcc53366f5
parentf25c88375b0fc03a97a423b565217fb9b55f7850 (diff)
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 <MASTERVOL> \ <SLAVEHOST>::<SLAVEVOL> config replica_failover_interval 15 Change-Id: Iada1b80d510452dcfedebd8a21bebd62394b0597 BUG: 1066410 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/8003 Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: Venky Shankar <vshankar@redhat.com>
-rw-r--r--geo-replication/syncdaemon/gsyncd.py2
-rw-r--r--geo-replication/syncdaemon/master.py2
2 files changed, 3 insertions, 1 deletions
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()