summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanju Rakonde <srakonde@redhat.com>2019-01-04 15:49:53 +0530
committerSanju Rakonde <srakonde@redhat.com>2019-01-04 18:13:46 +0530
commit95ec7391d8db26b933e542694add2b419dddf89f (patch)
treefb5bb5b3817e11972d23a643f4814b7015823b09
parentf6d0141b47ac36f6d2b100252241ed64bc92f913 (diff)
glusterd: rebalance status should display information of localhost
Problem: https://review.gluster.org/#/c/glusterfs/+/21762/ has migrated rebalance commands from op-sm framework to mgmt v3 framework. In a heterogenous cluster, if rebalance commands follow op-sm framework, localhost information is not displayed in the output of "gluster v rebalance <volname> status". Cause: Previously without https://review.gluster.org/#/c/glusterfs/+/21762/ rebalance commands were following op-sm framework. In glusterd_volume_rebalance_use_rsp_dict() current_index variable keeps track of number/count of peers in trusted storage pool. In op-sm, glusterd_volume_rebalance_use_rsp_dict() will be called only for the peers. So the current index should start from 2 assuming local host as node 1. With the above patch, rebalance commands are following mgmt v3 framework. In mgmt v3, glusterd_volume_rebalance_use_rsp_dict() is called for all nodes. For localhost it is called from brick-op function and for peers it is called from brick-op call back function. So the current index value should start from 1. https://review.gluster.org/#/c/glusterfs/+/21762/ has changed the value of current index to 1. Because of this, In heterogenous cluster, local host's information is overwritten by one of the peers information. And rebalance status will not display localhost's information in the output. Solution: assign a value to current index based on a op-version check. Change-Id: I2dfba1f007e908cf160acc4a4a5d8ef672572e4d fixes: bz#1663243 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index ae6d4cedae1..81d559ee338 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -10789,6 +10789,8 @@ glusterd_volume_rebalance_use_rsp_dict(dict_t *aggr, dict_t *rsp_dict)
GF_ASSERT(this);
conf = this->private;
+ if (conf->op_version < GD_OP_VERSION_6_0)
+ current_index = 2;
if (aggr) {
ctx_dict = aggr;