diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2016-01-29 16:24:02 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2016-02-22 21:42:03 -0800 |
commit | a67331f3f79e827ffa4f7a547f6898e12407bbf9 (patch) | |
tree | 3f6b94b05026cd720d2ea98db5189cae002addd0 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 1fd7655ab0795e5aa96cdbfb8c522b222734f4f2 (diff) |
glusterd/rebalance: initialize defrag variable after glusterd restart
During reblance restart after glusterd restarted, we are not
connecting to rebalance process from glusterd, because the
defrag variable in volinfo will be null.
Initializing the variable will connect the rpc
Change-Id: Id820cad6a3634a9fc976427fbe1c45844d3d4b9b
BUG: 1303028
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/13319
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 49b88ed4b13..f1b1a3c0c59 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -7136,6 +7136,15 @@ glusterd_volume_defrag_restart (glusterd_volinfo_t *volinfo, char *op_errstr, case GF_DEFRAG_STATUS_STARTED: GLUSTERD_GET_DEFRAG_PID_FILE(pidfile, volinfo, priv); if (gf_is_service_running (pidfile, &pid)) { + ret = glusterd_rebalance_defrag_init (volinfo, cbk); + if (ret) { + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_REBALANCE_START_FAIL, + "Failed to initialize defrag." + "Not starting rebalance process for " + "%s.", volinfo->volname); + goto out; + } ret = glusterd_rebalance_rpc_create (volinfo, _gf_true); break; } @@ -7151,7 +7160,7 @@ glusterd_volume_defrag_restart (glusterd_volinfo_t *volinfo, char *op_errstr, volinfo->rebal.defrag_status, volinfo->volname); break; } - +out: return ret; } |