summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
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 /xlators/mgmt/glusterd/src/glusterd-utils.c
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 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index a2a746d247e..15e91ad24dd 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -6572,6 +6572,7 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data)
char *op_errstr = NULL;
glusterd_conf_t *priv = NULL;
gf_boolean_t is_template_in_use = _gf_false;
+ gf_boolean_t is_paused = _gf_false;
GF_ASSERT (THIS);
priv = THIS->private;
@@ -6665,9 +6666,9 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data)
"%s and %s::%s. Not Restarting", volinfo->volname,
slave_ip, slave_vol);
goto out;
- }
-
- if ((!strcmp (buf, "Config Corrupted"))) {
+ } else if (strstr(buf, "Paused")) {
+ is_paused = _gf_true;
+ } else if ((!strcmp (buf, "Config Corrupted"))) {
gf_log ("", GF_LOG_INFO,
"Recovering from a corrupted config. "
"Not Restarting. Use start (force) to "
@@ -6677,8 +6678,12 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data)
goto out;
}
- glusterd_start_gsync (volinfo, slave, path_list, confpath,
- uuid_str, NULL);
+ if (is_paused)
+ glusterd_start_gsync (volinfo, slave, path_list, confpath,
+ uuid_str, NULL, _gf_true);
+ else
+ glusterd_start_gsync (volinfo, slave, path_list, confpath,
+ uuid_str, NULL, _gf_false);
out:
if (statefile)
@@ -8294,7 +8299,7 @@ int
glusterd_start_gsync (glusterd_volinfo_t *master_vol, char *slave,
char *path_list, char *conf_path,
char *glusterd_uuid_str,
- char **op_errstr)
+ char **op_errstr, gf_boolean_t is_pause)
{
int32_t ret = 0;
int32_t status = 0;
@@ -8356,6 +8361,8 @@ glusterd_start_gsync (glusterd_volinfo_t *master_vol, char *slave,
runner_argprintf (&runner, "--glusterd-uuid=%s",
uuid_utoa (priv->uuid));
runner_add_arg (&runner, slave);
+ if (is_pause)
+ runner_add_arg (&runner, "--pause-on-start");
synclock_unlock (&priv->big_lock);
ret = runner_run (&runner);
synclock_lock (&priv->big_lock);