diff options
author | shishir gowda <shishirng@gluster.com> | 2012-04-04 16:04:10 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-04-06 03:38:49 -0700 |
commit | 1222e2ae2d42cf12569a0cf00bb1f1504ef4e7b7 (patch) | |
tree | 657744f7c1b5828294473438c1c64f670c77bce4 /xlators/mgmt/glusterd/src/glusterd-brick-ops.c | |
parent | 7768d700a18f5bdb1e4640070ec5dd380384c7a9 (diff) |
remove-brick: Abort should revert volume changes
Also, enhanced gluster cli output.
Signed-off-by: shishir gowda <shishirng@gluster.com>
Change-Id: I520ccfb63b3568a2e6654d8a5fbf265b9b903af1
BUG: 788524
Reviewed-on: http://review.gluster.com/3082
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-brick-ops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-brick-ops.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c index 8fdedbd32a4..aa57341ffd7 100644 --- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c @@ -1250,14 +1250,7 @@ glusterd_op_stage_remove_brick (dict_t *dict, char **op_errstr) case GF_OP_CMD_PAUSE: case GF_OP_CMD_ABORT: - { - if (!volinfo->decommission_in_progress) { - errstr = gf_strdup("remove-brick is not in progress"); - gf_log ("glusterd", GF_LOG_ERROR, "%s", errstr); - goto out; - } break; - } case GF_OP_CMD_COMMIT: if (volinfo->decommission_in_progress) { @@ -1523,13 +1516,29 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr) } /* Fall back to the old volume file */ - list_for_each_entry_safe (brickinfo, tmp, &volinfo->bricks, brick_list) { + list_for_each_entry_safe (brickinfo, tmp, &volinfo->bricks, + brick_list) { if (!brickinfo->decommissioned) continue; brickinfo->decommissioned = 0; } + ret = glusterd_create_volfiles_and_notify_services (volinfo); + if (ret) { + gf_log (THIS->name, GF_LOG_WARNING, + "failed to create volfiles"); + goto out; + } + + ret = glusterd_store_volinfo (volinfo, + GLUSTERD_VOLINFO_VER_AC_INCREMENT); + if (ret) { + gf_log (THIS->name, GF_LOG_WARNING, + "failed to store volinfo"); + goto out; + } + ret = 0; - break; + goto out; } case GF_OP_CMD_START: |