diff options
author | Pavan Sondur <pavan@gluster.com> | 2010-10-04 12:15:34 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-10-04 11:37:38 -0700 |
commit | dc1113c4a02b1b1186bf37e09685631891d85537 (patch) | |
tree | 8d992bb7ed8283b02d7648fc765a0c86426460f8 /xlators/mgmt/glusterd/src/glusterd-op-sm.c | |
parent | 841ee8d5021980d836c834792b581475b05b0e6b (diff) |
cli: mgmt/glusterd: Add commit force op to replace-brick
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1235 (Bug for all pump/migrate commits)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1235
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 3109e173b34..b43b88a3bf7 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -2639,11 +2639,12 @@ glusterd_op_replace_brick (gd1_mgmt_stage_op_req *req, dict_t *rsp_dict) src_brickinfo->port = pmap_registry_search (this, src_brickinfo->path, GF_PMAP_PORT_BRICKSERVER); - if (!src_brickinfo->port) { - gf_log ("", GF_LOG_ERROR, + if (!src_brickinfo->port && + replace_op != GF_REPLACE_OP_COMMIT_FORCE ) { + gf_log ("", GF_LOG_ERROR, "Src brick port not available"); - ret = -1; - goto out; + ret = -1; + goto out; } if (rsp_dict) { @@ -2721,6 +2722,7 @@ glusterd_op_replace_brick (gd1_mgmt_stage_op_req *req, dict_t *rsp_dict) } case GF_REPLACE_OP_COMMIT: + case GF_REPLACE_OP_COMMIT_FORCE: { ret = dict_set_int32 (volinfo->dict, "enable-pump", 0); @@ -2728,7 +2730,8 @@ glusterd_op_replace_brick (gd1_mgmt_stage_op_req *req, dict_t *rsp_dict) "Received commit - will be adding dst brick and " "removing src brick"); - if (!glusterd_is_local_addr (dst_brickinfo->hostname)) { + if (!glusterd_is_local_addr (dst_brickinfo->hostname) && + replace_op != GF_REPLACE_OP_COMMIT_FORCE) { gf_log ("", GF_LOG_NORMAL, "I AM THE DESTINATION HOST"); ret = rb_kill_destination_brick (volinfo, dst_brickinfo); @@ -4018,8 +4021,8 @@ glusterd_do_replace_brick (void *data) break; case GF_REPLACE_OP_PAUSE: case GF_REPLACE_OP_ABORT: - break; case GF_REPLACE_OP_COMMIT: + case GF_REPLACE_OP_COMMIT_FORCE: case GF_REPLACE_OP_STATUS: break; default: |