summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon/monitor.py
diff options
context:
space:
mode:
authorKotresh H R <khiremat@redhat.com>2014-05-25 23:41:48 +0530
committerVenky Shankar <vshankar@redhat.com>2014-06-05 22:58:26 -0700
commit77498fdbbca8554880eae4b8f559b9d6876e35b7 (patch)
tree29662e2b91634c1abd1c107d5aeeb1d2a4434698 /geo-replication/syncdaemon/monitor.py
parent535003ca20a9dd00a09dd34ad26947d888aabe39 (diff)
feature/geo-rep: Fix to retain pause state of gsyncd on restart.
A new gsyncd options '--pause-on-start' is introduced. When node reboots, if the status is paused, gsyncd is started with this option. After gsyncd spawns worker and agent, worker will send SIGSTOP to negative pid of monitor to enter pause mode. Change-Id: I5aad82c9a9fc8c243f384940b77d25e26e520d6d BUG: 1101410 Signed-off-by: Kotresh H R <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/7885 Reviewed-by: Aravinda VK <avishwan@redhat.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/monitor.py')
-rw-r--r--geo-replication/syncdaemon/monitor.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/geo-replication/syncdaemon/monitor.py b/geo-replication/syncdaemon/monitor.py
index f485fe18605..f3700c1a390 100644
--- a/geo-replication/syncdaemon/monitor.py
+++ b/geo-replication/syncdaemon/monitor.py
@@ -73,10 +73,11 @@ class Monitor(object):
"""class which spawns and manages gsyncd workers"""
ST_INIT = 'Initializing...'
+ ST_INIT_PAUSE = 'Initializing...(Paused)'
ST_STABLE = 'Stable'
ST_FAULTY = 'faulty'
ST_INCON = 'inconsistent'
- _ST_ORD = [ST_STABLE, ST_INIT, ST_FAULTY, ST_INCON]
+ _ST_ORD = [ST_STABLE, ST_INIT, ST_INIT_PAUSE, ST_FAULTY, ST_INCON]
def __init__(self):
self.lock = Lock()
@@ -128,7 +129,11 @@ class Monitor(object):
due to the keep-alive thread)
"""
- self.set_state(self.ST_INIT, w)
+ if gconf.pause_on_start:
+ self.set_state(self.ST_INIT_PAUSE, w)
+ else:
+ self.set_state(self.ST_INIT, w)
+
ret = 0
def nwait(p, o=0):