From 95ec7391d8db26b933e542694add2b419dddf89f Mon Sep 17 00:00:00 2001 From: Sanju Rakonde Date: Fri, 4 Jan 2019 15:49:53 +0530 Subject: 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 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 --- xlators/mgmt/glusterd/src/glusterd-utils.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xlators/mgmt/glusterd') 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; -- cgit