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 | |
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')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 4 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 15 |
2 files changed, 12 insertions, 7 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 48dc673edb5..ee547639e0b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -1142,7 +1142,7 @@ glusterd_handle_replace_brick (rpcsvc_request_t *req) char *src_brick = NULL; char *dst_brick = NULL; int32_t op = 0; - char operation[8]; + char operation[256]; GF_ASSERT (req); @@ -1210,6 +1210,8 @@ glusterd_handle_replace_brick (rpcsvc_request_t *req) break; case GF_REPLACE_OP_STATUS: strcpy (operation, "status"); break; + case GF_REPLACE_OP_COMMIT_FORCE: strcpy (operation, "commit-force"); + break; default:strcpy (operation, "unknown"); break; } 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: |