From 96e1c33b681b34124bdc78174a21865623c9795b Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Tue, 28 Oct 2014 13:06:50 +0530 Subject: glusterd: Store rebalance state on all peers The rebalance state was being saved only on the peers participating in the rebalance on a rebalance start. This change makes sure all nodes save the rebalance state. Change-Id: I436e5c34bcfb88f7da7378cec807328ce32397bc BUG: 1157979 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.org/8998 Reviewed-by: Atin Mukherjee Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-rebalance.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c index dac36d4bf1f..fd63a9bafc6 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c +++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c @@ -733,8 +733,18 @@ glusterd_op_rebalance (dict_t *dict, char **op_errstr, dict_t *rsp_dict) uuid_parse (task_id_str, volinfo->rebal.rebalance_id) ; volinfo->rebal.op = GD_OP_REBALANCE; } - if (!gd_should_i_start_rebalance (volinfo)) + if (!gd_should_i_start_rebalance (volinfo)) { + /* Store the rebalance-id and rebalance command even if + * the peer isn't starting a rebalance process. On peers + * where a rebalance process is started, + * glusterd_handle_defrag_start performs the storing. + * + * Storing this is needed for having 'volume status' + * work correctly. + */ + glusterd_store_perform_node_state_store (volinfo); break; + } ret = glusterd_handle_defrag_start (volinfo, msg, sizeof (msg), cmd, NULL, GD_OP_REBALANCE); break; -- cgit