summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
diff options
context:
space:
mode:
authorSanju Rakonde <srakonde@redhat.com>2018-03-26 13:18:07 +0530
committerSanju Rakonde <srakonde@redhat.com>2018-03-26 20:10:25 +0530
commit9c047f4cae22121b2382551ab56a694665603fd7 (patch)
tree34abf63ed1550ae5ab40cc575b121eb7a1f52c30 /xlators/mgmt/glusterd/src/glusterd-volume-ops.c
parenta6116794281a6046e05bc87ab7fb39410dfc6a9f (diff)
glusterd: Implementing volume stop in mgmt v3
Change-Id: I8f9c594cf56331d54eb4884335699744685ef20d fixes: bz#1560441 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-ops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-ops.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
index 216b403867c..4001230358c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
@@ -588,10 +588,13 @@ __glusterd_handle_cli_stop_volume (rpcsvc_request_t *req)
glusterd_op_t cli_op = GD_OP_STOP_VOLUME;
xlator_t *this = NULL;
char err_str[2048] = {0,};
+ glusterd_conf_t *conf = NULL;
this = THIS;
GF_ASSERT (this);
GF_ASSERT (req);
+ conf = this->private;
+ GF_ASSERT (conf);
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
if (ret < 0) {
@@ -633,7 +636,18 @@ __glusterd_handle_cli_stop_volume (rpcsvc_request_t *req)
gf_msg_debug (this->name, 0, "Received stop vol req "
"for volume %s", dup_volname);
- ret = glusterd_op_begin_synctask (req, GD_OP_STOP_VOLUME, dict);
+ if (conf->op_version <= GD_OP_VERSION_4_1_0) {
+ gf_msg_debug (this->name, 0, "The cluster is operating at "
+ "version less than or equal to %d. Volume start "
+ "falling back to syncop framework.",
+ GD_OP_VERSION_4_1_0);
+ ret = glusterd_op_begin_synctask (req, GD_OP_STOP_VOLUME,
+ dict);
+ } else {
+ ret = glusterd_mgmt_v3_initiate_all_phases (req,
+ GD_OP_STOP_VOLUME,
+ dict);
+ }
out:
free (cli_req.dict.dict_val); //its malloced by xdr
@@ -2802,6 +2816,7 @@ glusterd_op_stop_volume (dict_t *dict)
goto out;
}
out:
+ gf_msg_trace (this->name, 0, "returning %d ", ret);
return ret;
}