summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorKrishnan P <kp@gluster.com>2011-06-16 01:27:42 +0000
committerAnand Avati <avati@gluster.com>2011-06-16 09:15:11 -0700
commit4e6f6408b0e177dcdc0b19561bbaab6b7e26c23a (patch)
tree207d865a5982040efb70c3dba137bb571f082f62 /xlators/mgmt
parent87508c1edc7b8f4a88b2506ac642e878b1f2ac16 (diff)
glusterd: do_operation_abort and then kill dst_brick.
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 3033 (Changes to replace-brick and syntask interface.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3033
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c25
1 files 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;