diff options
author | Pavan Sondur <pavan@gluster.com> | 2010-09-09 05:44:49 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-09 05:23:35 -0700 |
commit | 6ee84e00f0d96e292163ebad86b2e7521776dca1 (patch) | |
tree | 21e6b4feaf2280236258d7518814e714608546dd /xlators | |
parent | 80439c92add5aa54ee628697d4b27c9b56692fd0 (diff) |
mgmt/glusterd: Do not check for src/dst while issuing replace brick cmds.
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1582 (replace-brick data missing added brick)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1582
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 156 |
1 files changed, 70 insertions, 86 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 19bc73e15..a70df3ed3 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1722,52 +1722,38 @@ rb_do_operation_start (glusterd_volinfo_t *volinfo, { char start_value[8192] = {0,}; int ret = -1; - gf_boolean_t src_host = _gf_false; - gf_boolean_t dst_host = _gf_false; - if (!glusterd_is_local_addr (src_brickinfo->hostname)) { - gf_log ("", GF_LOG_NORMAL, - "I AM THE SOURCE HOST"); - ret = rb_spawn_maintainence_client (volinfo, src_brickinfo); - if (ret) { - gf_log ("", GF_LOG_DEBUG, - "Could not spawn maintainence " - "client"); - goto out; - } + gf_log ("", GF_LOG_NORMAL, + "replace-brick sending start xattr"); - snprintf (start_value, 8192, "%s:%s:", - dst_brickinfo->hostname, - dst_brickinfo->path); + ret = rb_spawn_maintainence_client (volinfo, src_brickinfo); + if (ret) { + gf_log ("", GF_LOG_DEBUG, + "Could not spawn maintainence " + "client"); + goto out; + } - src_host = _gf_true; + snprintf (start_value, 8192, "%s:%s:", + dst_brickinfo->hostname, + dst_brickinfo->path); - } - if (!src_host && !dst_host) { + ret = rb_send_xattr_command (volinfo, src_brickinfo, + dst_brickinfo, RB_PUMP_START_CMD, + start_value); + if (ret) { gf_log ("", GF_LOG_DEBUG, - "Not a source or destination brick"); - ret = 0; + "Failed to send command to pump"); goto out; } - if (src_host) { - ret = rb_send_xattr_command (volinfo, src_brickinfo, - dst_brickinfo, RB_PUMP_START_CMD, - start_value); - if (ret) { - gf_log ("", GF_LOG_DEBUG, - "Failed to send command to pump"); - goto out; - } - - ret = rb_destroy_maintainence_client (volinfo, src_brickinfo); - if (ret) { - gf_log ("", GF_LOG_DEBUG, - "Failed to destroy maintainence " - "client"); - goto out; - } + ret = rb_destroy_maintainence_client (volinfo, src_brickinfo); + if (ret) { + gf_log ("", GF_LOG_DEBUG, + "Failed to destroy maintainence " + "client"); + goto out; } ret = 0; @@ -1783,33 +1769,32 @@ rb_do_operation_pause (glusterd_volinfo_t *volinfo, { int ret = -1; - if (!glusterd_is_local_addr (src_brickinfo->hostname)) { - gf_log ("", GF_LOG_NORMAL, - "I AM THE SOURCE HOST"); - ret = rb_spawn_maintainence_client (volinfo, src_brickinfo); - if (ret) { - gf_log ("", GF_LOG_DEBUG, - "Could not spawn maintainence " - "client"); - goto out; - } + gf_log ("", GF_LOG_NORMAL, + "replace-brick send pause xattr"); - ret = rb_send_xattr_command (volinfo, src_brickinfo, - dst_brickinfo, RB_PUMP_PAUSE_CMD, - "jargon"); - if (ret) { - gf_log ("", GF_LOG_DEBUG, - "Failed to send command to pump"); - goto out; - } + ret = rb_spawn_maintainence_client (volinfo, src_brickinfo); + if (ret) { + gf_log ("", GF_LOG_DEBUG, + "Could not spawn maintainence " + "client"); + goto out; + } - ret = rb_destroy_maintainence_client (volinfo, src_brickinfo); - if (ret) { - gf_log ("", GF_LOG_DEBUG, - "Failed to destroy maintainence " - "client"); - goto out; - } + ret = rb_send_xattr_command (volinfo, src_brickinfo, + dst_brickinfo, RB_PUMP_PAUSE_CMD, + "jargon"); + if (ret) { + gf_log ("", GF_LOG_DEBUG, + "Failed to send command to pump"); + goto out; + } + + ret = rb_destroy_maintainence_client (volinfo, src_brickinfo); + if (ret) { + gf_log ("", GF_LOG_DEBUG, + "Failed to destroy maintainence " + "client"); + goto out; } ret = 0; @@ -1876,33 +1861,32 @@ rb_do_operation_abort (glusterd_volinfo_t *volinfo, { int ret = -1; - if (!glusterd_is_local_addr (src_brickinfo->hostname)) { + gf_log ("", GF_LOG_DEBUG, + "replace-brick sending abort xattr"); + + ret = rb_spawn_maintainence_client (volinfo, src_brickinfo); + if (ret) { gf_log ("", GF_LOG_DEBUG, - "I AM THE SOURCE HOST"); - ret = rb_spawn_maintainence_client (volinfo, src_brickinfo); - if (ret) { - gf_log ("", GF_LOG_DEBUG, - "Could not spawn maintainence " - "client"); - goto out; - } + "Could not spawn maintainence " + "client"); + goto out; + } - ret = rb_send_xattr_command (volinfo, src_brickinfo, - dst_brickinfo, RB_PUMP_ABORT_CMD, - "jargon"); - if (ret) { - gf_log ("", GF_LOG_DEBUG, - "Failed to send command to pump"); - goto out; - } + ret = rb_send_xattr_command (volinfo, src_brickinfo, + dst_brickinfo, RB_PUMP_ABORT_CMD, + "jargon"); + if (ret) { + gf_log ("", GF_LOG_DEBUG, + "Failed to send command to pump"); + goto out; + } - ret = rb_destroy_maintainence_client (volinfo, src_brickinfo); - if (ret) { - gf_log ("", GF_LOG_DEBUG, - "Failed to destroy maintainence " - "client"); - goto out; - } + ret = rb_destroy_maintainence_client (volinfo, src_brickinfo); + if (ret) { + gf_log ("", GF_LOG_DEBUG, + "Failed to destroy maintainence " + "client"); + goto out; } ret = 0; |