summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kp@gluster.com>2012-05-17 14:14:13 +0530
committerVijay Bellur <vijay@gluster.com>2012-05-19 02:35:48 -0700
commit2c2dbe72edb64b80144d9fb861886c0ceb5dc757 (patch)
treed28f98398521a45119156364855ab67007ebc316
parent43ff1680d9135bbc85dad24f51f02996d22580df (diff)
glusterd: replace-brick should create dst brick path only once.
Change-Id: I51d1a5315fa7a4290a63a59c1ef14b3e82cdc929 BUG: 822338 Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> Reviewed-on: http://review.gluster.com/3354 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-replace-brick.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
index c31d8c78183..58829832683 100644
--- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
+++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
@@ -321,8 +321,7 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
break;
case GF_REPLACE_OP_ABORT:
- if ((!glusterd_is_rb_paused (volinfo)) &&
- (!glusterd_is_rb_started (volinfo))) {
+ if (!glusterd_is_rb_ongoing (volinfo)) {
gf_log ("", GF_LOG_ERROR, "Replace brick is not"
" started or paused for volume ");
ret = -1;
@@ -331,7 +330,7 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
break;
case GF_REPLACE_OP_COMMIT:
- if (!glusterd_is_rb_started (volinfo)) {
+ if (!glusterd_is_rb_ongoing (volinfo)) {
gf_log ("", GF_LOG_ERROR, "Replace brick is not "
"started for volume ");
ret = -1;
@@ -445,7 +444,7 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
if (ret)
goto out;
- if ((volinfo->rb_status ==GF_RB_STATUS_NONE) &&
+ if (!glusterd_is_rb_ongoing (volinfo) &&
(replace_op == GF_REPLACE_OP_START ||
replace_op == GF_REPLACE_OP_COMMIT_FORCE)) {
@@ -463,13 +462,15 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,
goto out;
}
- if (!glusterd_is_local_addr (host)) {
+ if (!glusterd_is_rb_ongoing (volinfo)) {
ret = glusterd_brick_create_path (host, path,
volinfo->volume_id,
op_errstr);
if (ret)
goto out;
- } else {
+ }
+
+ if (glusterd_is_local_addr (host)) {
ret = glusterd_friend_find (NULL, host, &peerinfo);
if (ret) {
snprintf (msg, sizeof (msg), "%s, is not a friend",