From 4e6f6408b0e177dcdc0b19561bbaab6b7e26c23a Mon Sep 17 00:00:00 2001 From: Krishnan P Date: Thu, 16 Jun 2011 01:27:42 +0000 Subject: glusterd: do_operation_abort and then kill dst_brick. Signed-off-by: Krishnan Parthasarathi Signed-off-by: Anand Avati BUG: 3033 (Changes to replace-brick and syntask interface.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3033 --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 2eb88d7239a..a802149212e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -3977,13 +3977,24 @@ glusterd_op_replace_brick (dict_t *dict, dict_t *rsp_dict) case GF_REPLACE_OP_ABORT: { + ctx = glusterd_op_get_ctx (GD_OP_REPLACE_BRICK); + if (ctx) { + ret = rb_do_operation_abort (volinfo, src_brickinfo, dst_brickinfo); + if (ret) { + gf_log (THIS->name, GF_LOG_ERROR, + "Abort operation failed"); + goto out; + } + } + ret = dict_set_int32 (volinfo->dict, "enable-pump", 0); if (ret) { - gf_log ("", GF_LOG_CRITICAL, "Unable to disable pump"); + gf_log (THIS->name, GF_LOG_CRITICAL, "Unable to disable pump"); } + if (!glusterd_is_local_addr (dst_brickinfo->hostname)) { - gf_log ("", GF_LOG_INFO, + gf_log (THIS->name, GF_LOG_INFO, "I AM THE DESTINATION HOST"); ret = rb_kill_destination_brick (volinfo, dst_brickinfo); if (ret) { @@ -3992,16 +4003,6 @@ glusterd_op_replace_brick (dict_t *dict, dict_t *rsp_dict) goto out; } } - - ctx = glusterd_op_get_ctx (GD_OP_REPLACE_BRICK); - if (ctx) { - ret = rb_do_operation_abort (volinfo, src_brickinfo, dst_brickinfo); - if (ret) { - gf_log ("", GF_LOG_ERROR, - "Abort operation failed"); - goto out; - } - } glusterd_set_rb_status (volinfo, GF_RB_STATUS_NONE); glusterd_brickinfo_delete (volinfo->dst_brick); volinfo->src_brick = volinfo->dst_brick = NULL; -- cgit