summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2015-09-07 14:46:33 +0530
committerDan Lambright <dlambrig@redhat.com>2015-10-08 21:21:07 -0700
commit4ad9bc5faca60528345f1e9c95c22bd8402162c0 (patch)
tree0fbda8ccd5b7e3ac8f43ae5b3646eac0dce19582 /xlators/mgmt/glusterd/src/glusterd-brick-ops.c
parentf6714230e8335f7508fa871dcd9d8af708f15347 (diff)
tiering/glusterd: keep afr/ec xlators name constant
afr uses the translator name for locking purpose, so it is mandatory to keep afr/ec xlators name constant across graph change currently when a tier is attached, afr names are appended either with hot or cold. ie that breaks the above mentioned constraint. Change-Id: I3699dcdaa8190bab3ba81cbc01e8fa126d37ba0d BUG: 1261276 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/12134 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-brick-ops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index fa652ac60c1..74e5aba7e1c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -2323,7 +2323,8 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr)
int start_remove = 0;
uint32_t commit_hash = 0;
int defrag_cmd = 0;
-
+ int detach_commit = 0;
+ void *tier_info = NULL;
this = THIS;
GF_ASSERT (this);
@@ -2447,6 +2448,7 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr)
case GF_OP_CMD_DETACH_COMMIT:
case GF_OP_CMD_DETACH_COMMIT_FORCE:
glusterd_op_perform_detach_tier (volinfo);
+ detach_commit = 1;
/* fall through */
case GF_OP_CMD_COMMIT_FORCE:
@@ -2536,6 +2538,13 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr)
goto out;
i++;
}
+
+ if (detach_commit) {
+ /* Clear related information from volinfo */
+ tier_info = ((void *)(&volinfo->tier_info));
+ memset (tier_info, 0, sizeof (volinfo->tier_info));
+ }
+
if (start_remove)
volinfo->rebal.dict = dict_ref (bricks_dict);
@@ -2629,9 +2638,8 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr)
if (GLUSTERD_STATUS_STARTED == volinfo->status)
ret = glusterd_svcs_manager (volinfo);
}
-
out:
- if (ret && err_str[0] && op_errstr)
+ if (ret && err_str[0] && op_errstr)
*op_errstr = gf_strdup (err_str);
GF_FREE (brick_tmpstr);