summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c15
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: