diff options
author | Avra Sengupta <asengupt@redhat.com> | 2013-07-29 19:05:50 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-07-31 09:17:39 -0700 |
commit | d90b46a23a523720f4e40de993ca61ff0ba43617 (patch) | |
tree | 5c7a4ccddc49292296387de7f092f2476cd5ad8d /xlators/mgmt/glusterd/src/glusterd-geo-rep.c | |
parent | 031b69fc7b2f26d07113aabec95662816adfad86 (diff) |
glusterd : Checking session created or not in case of geo-rep stop
Performing statefile check in case of geo-rep stop, so as to provide
proper error message in case session is not created.
However in case of geo-rep stop force, we allow the command to succeed
even in case that the session is not created, because the stop command
is a failsafe command to stop running geo-rep sessions on any nodes.
Change-Id: I2b6a0253de977633606c422cbbc9e37cede9a268
BUG: 989541
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/5417
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-geo-rep.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-geo-rep.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c index d785cb05bfa..386d7a95289 100644 --- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c +++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c @@ -1947,7 +1947,13 @@ glusterd_op_stage_gsync_set (dict_t *dict, char **op_errstr) goto out; } + is_force = dict_get_str_boolean (dict, "force", _gf_false); + + /* Allowing stop force to bypass the statefile check + * as this command acts as a fail safe method to stop geo-rep + * session. */ if ((type == GF_GSYNC_OPTION_TYPE_CONFIG) || + ((type == GF_GSYNC_OPTION_TYPE_STOP) && !is_force) || (type == GF_GSYNC_OPTION_TYPE_DELETE)) { ret = lstat (statefile, &stbuf); if (ret) { @@ -1962,8 +1968,6 @@ glusterd_op_stage_gsync_set (dict_t *dict, char **op_errstr) } } - is_force = dict_get_str_boolean (dict, "force", _gf_false); - /* Check if all peers that are a part of the volume are up or not */ if ((type == GF_GSYNC_OPTION_TYPE_DELETE) || ((type == GF_GSYNC_OPTION_TYPE_STOP) && !is_force)) { |