From 53cd14b75f65ef602c766fce6ab7b8a25ca5b514 Mon Sep 17 00:00:00 2001 From: Hari Gowtham Date: Fri, 21 Aug 2015 18:18:09 +0530 Subject: glusterd: volume status backward compatibility volume status message of 3.7 does not display all the brick in a mixed cluster(3.6 and 3.7). it displays the bricks in 3.7 and misses bricks in 3.6 due to the key difference for ports. Status of volume: vol1 Gluster process TCP Port RDMA Port Online Pid ------------------------------------------------------------------------------ Brick 10.70.42.171:/data/gluster/tier/cbr2 49153 0 Y 13494 Brick 10.70.42.203:/data/gluster/tier/cbr2 49154 0 Y 27686 NFS Server on localhost N/A N/A N N/A NFS Server on dhcp42-203.lab.eng.blr.redhat .com N/A N/A N N/A Task Status of Volume vol1 ------------------------------------------------------------------------------ There are no active volume tasks Change-Id: Icf0dc01a3d21d0889c43e2868c646a0c7e07ff25 BUG: 1255694 Signed-off-by: Hari Gowtham Reviewed-on: http://review.gluster.org/11986 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: mohammed rafi kc Reviewed-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 73121250f1e..c098c274992 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -4436,6 +4436,9 @@ glusterd_op_modify_op_ctx (glusterd_op_t op, void *ctx) glusterd_conf_t *conf = NULL; char *volname = NULL; glusterd_volinfo_t *volinfo = NULL; + char *port = 0; + int i = 0; + char key[1024] = {0,}; this = THIS; GF_ASSERT (this); @@ -4495,6 +4498,17 @@ glusterd_op_modify_op_ctx (glusterd_op_t op, void *ctx) if (ret) goto out; + for (i = 0; i <= brick_index_max; i++) { + memset (key, 0, sizeof (key)); + snprintf (key, sizeof (key), "brick%d.rdma_port", i); + ret = dict_get_str (op_ctx, key, &port); + if (ret) { + ret = dict_set_str (op_ctx, key, "\0"); + if (ret) + goto out; + } + } + glusterd_volinfo_find (volname, &volinfo); if (conf->op_version < GD_OP_VERSION_3_7_0 && volinfo->transport_type == GF_TRANSPORT_RDMA) { -- cgit