diff options
author | Sanju Rakonde <srakonde@redhat.com> | 2018-11-08 18:50:18 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2018-12-04 16:21:42 +0000 |
commit | e48678567a5fb01166a065f9e192b80e721e4181 (patch) | |
tree | 3eae2f19e1d9f584e9759baa3265fd0915a4c963 /xlators/mgmt/glusterd/src/glusterd-handler.c | |
parent | 8e8f4bf3fa16d3790a5eb74b8f07b904024ee9d8 (diff) |
glusterd: migrating profile commands to mgmt_v3 framework
Current profile commands use the op_state machine framework.
Porting it to use the mgmt_v3 framework.
The following tests were performed on the patch:
case 1:
1. On a 3 node cluster, created and started 3 volumes
2. Mounted all the three volumes and wrote some data
3. Started profile operation for all the volumes
4. Ran "gluster v status" from N1,
"gluster v profile <volname1> info" form N2,
"gluster v profile <volname2> info" from N3 simultaneously in a
loop for around 10000 times
5. Didn't find any cores generated.
case 2:
1. Repeat the steps 1,2 and 3 from case 1.
2. Ran "gluster v status" from N1,
"gluster v profile <volname1> info" form N2(terminal 1),
"gluster v profile <volname2> info" from N2(terminal 2)
simultaneously in a loop.
3. No cores were generated.
fixes: bz#1654181
Change-Id: I83044cf5aee3970ef94066c89fcc41783ed468a6
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index db58b3af8cf..1da6d27e18a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -27,6 +27,7 @@ #include "glusterd-sm.h" #include "glusterd-op-sm.h" #include "glusterd-utils.h" +#include "glusterd-mgmt.h" #include "glusterd-server-quorum.h" #include "glusterd-store.h" #include "glusterd-locks.h" @@ -3031,10 +3032,13 @@ __glusterd_handle_cli_profile_volume(rpcsvc_request_t *req) 0, }; xlator_t *this = NULL; + glusterd_conf_t *conf = NULL; GF_ASSERT(req); this = THIS; GF_ASSERT(this); + conf = this->private; + GF_VALIDATE_OR_GOTO(this->name, conf, out); ret = xdr_to_generic(req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req); if (ret < 0) { @@ -3075,12 +3079,20 @@ __glusterd_handle_cli_profile_volume(rpcsvc_request_t *req) goto out; } - ret = glusterd_op_begin(req, cli_op, dict, err_str, sizeof(err_str)); + if (conf->op_version < GD_OP_VERSION_6_0) { + gf_msg_debug(this->name, 0, + "The cluster is operating at " + "version less than %d. Falling back " + "to op-sm framework.", + GD_OP_VERSION_6_0); + ret = glusterd_op_begin(req, cli_op, dict, err_str, sizeof(err_str)); + glusterd_friend_sm(); + glusterd_op_sm(); + } else { + ret = glusterd_mgmt_v3_initiate_profile_phases(req, cli_op, dict); + } out: - glusterd_friend_sm(); - glusterd_op_sm(); - free(cli_req.dict.dict_val); if (ret) { |