diff options
author | Kotresh H R <khiremat@redhat.com> | 2014-05-25 23:41:48 +0530 |
---|---|---|
committer | Venky Shankar <vshankar@redhat.com> | 2014-06-05 22:58:26 -0700 |
commit | 77498fdbbca8554880eae4b8f559b9d6876e35b7 (patch) | |
tree | 29662e2b91634c1abd1c107d5aeeb1d2a4434698 /geo-replication/syncdaemon/resource.py | |
parent | 535003ca20a9dd00a09dd34ad26947d888aabe39 (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/resource.py')
-rw-r--r-- | geo-replication/syncdaemon/resource.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index dadfc965336..8192a54b0d4 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -13,6 +13,7 @@ import os import sys import stat import time +import signal import fcntl import errno import types @@ -1290,6 +1291,13 @@ class GLUSTER(AbstractUrl, SlaveLocal, SlaveRemote): logging.debug("Changelog register failed: %s - %s" % (e.errno, e.strerror)) + # Check if gsyncd restarted in pause state. If + # yes, send SIGSTOP to negative of monitor pid + # to go back to pause state. + if gconf.pause_on_start: + os.kill(-os.getppid(), signal.SIGSTOP) + gconf.pause_on_start = False + # oneshot: Try to use changelog history api, if not # available switch to FS crawl # Note: if config.change_detector is xsync then |