diff options
author | hari gowtham <hgowtham@redhat.com> | 2015-12-16 16:18:29 +0530 |
---|---|---|
committer | Dan Lambright <dlambrig@redhat.com> | 2015-12-22 17:45:00 -0800 |
commit | 85d34ea0cf8b687c10093ae06417e498e252e563 (patch) | |
tree | 6b35a09be0beb6d87c8cf7e81d4f064a788e4aa7 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 86fa1507a15eb9e1e4a8e1e83785b5a46eee9aa4 (diff) |
Tier: "tier start force" command implementation
back port of : http://review.gluster.org/#/c/12983/
The start command doesnt restart the tier deamon if the deamon
is running at one node. hence to bring up the tierd on the nodes
where the deamon is down, the force command is implemented.
It skips the check for tierd running.
>Change-Id: I0037d3e5ecfe56637d0da201a97903c435d26436
>BUG: 1292112
>Signed-off-by: hari gowtham <hgowtham@redhat.com>
Change-Id: Idaca442c1a41ded8bf555a6e34eed0ebb9ea4034
BUG: 1293698
Signed-off-by: hari <hgowtham@redhat.com>
Reviewed-on: http://review.gluster.org/13069
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Tested-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index c9457e89b45..6fc0dcdc603 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -5647,7 +5647,7 @@ glusterd_is_tier_daemon_running (glusterd_volinfo_t *volinfo) return _gf_false; if (volinfo->rebal.defrag && - volinfo->rebal.defrag_cmd == GF_DEFRAG_CMD_START_TIER) { + volinfo->rebal.defrag_cmd == GF_DEFRAG_CMD_START_TIER) { return _gf_true; } @@ -7030,12 +7030,12 @@ 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)) { - glusterd_rebalance_rpc_create (volinfo, _gf_true); + ret = glusterd_rebalance_rpc_create (volinfo, _gf_true); break; } case GF_DEFRAG_STATUS_NOT_STARTED: - glusterd_handle_defrag_start (volinfo, op_errstr, len, cmd, - cbk, volinfo->rebal.op); + ret = glusterd_handle_defrag_start (volinfo, op_errstr, len, + cmd, cbk, volinfo->rebal.op); break; default: gf_msg (this->name, GF_LOG_ERROR, 0, @@ -7102,14 +7102,14 @@ out: } -void +int glusterd_restart_rebalance_for_volume (glusterd_volinfo_t *volinfo) { - + int ret = -1; char op_errstr[PATH_MAX]; if (!volinfo->rebal.defrag_cmd) - return; + return -1; if (!gd_should_i_start_rebalance (volinfo)) { /* Store the rebalance-id and rebalance command even if @@ -7123,10 +7123,11 @@ glusterd_restart_rebalance_for_volume (glusterd_volinfo_t *volinfo) if (volinfo->type == GF_CLUSTER_TYPE_TIER) glusterd_store_perform_node_state_store (volinfo); - return; + return 0; } - glusterd_volume_defrag_restart (volinfo, op_errstr, PATH_MAX, + ret = glusterd_volume_defrag_restart (volinfo, op_errstr, PATH_MAX, volinfo->rebal.defrag_cmd, NULL); + return ret; } int glusterd_restart_rebalance (glusterd_conf_t *conf) |