summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorDan Lambright <dlambrig@redhat.com>2015-06-04 14:00:34 -0400
committerNiels de Vos <ndevos@redhat.com>2015-06-11 07:41:11 -0700
commitb1ff2294d2aaf7dd36918837c09a68152adc0637 (patch)
tree084b69eeb9f4159de28035edd2b4bb955c42aed9 /xlators/mgmt
parent9863c8940936989d2ffb3c8ac28431d2b313384d (diff)
cluster/tier: account for reordered layouts
For a tiered volume the cold subvolume is always at a fixed position in the graph. DHT's layout array, on the other hand, may have the cold subvolume in either the first or second index, therefore code cannot make any assumptions. The fix searches the layout for the correct position dynamically rather than statically. The bug manifested itself in NFS, in which a newly attached subvolume had not received an existing directory. This case is a "stale entry" and marked as such in the layout for that directory. The code did not see this, because it looked at the wrong index in the layout array. The fix also adds the check for decomissioned bricks, and fixes a problem in detach tier related to starting the rebalance process: we never received the right defrag command and it did not get directed to the tier translator. Change-Id: I77cdf9fbb0a777640c98003188565a79be9d0b56 BUG: 1214289 Signed-off-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Joseph Fernandes <josferna@redhat.com> Reviewed-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/11092
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index 5c0ed1e304c..8fff9ab2cdf 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -2041,6 +2041,7 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr)
char *brick_tmpstr = NULL;
int start_remove = 0;
uint32_t commit_hash = 0;
+ int defrag_cmd = 0;
this = THIS;
GF_ASSERT (this);
@@ -2311,9 +2312,12 @@ glusterd_op_remove_brick (dict_t *dict, char **op_errstr)
volinfo->rebal.commit_hash = commit_hash;
}
/* perform the rebalance operations */
+ defrag_cmd = GF_DEFRAG_CMD_START_FORCE;
+ if (cmd == GF_OP_CMD_DETACH_START)
+ defrag_cmd = GF_DEFRAG_CMD_START_DETACH_TIER;
ret = glusterd_handle_defrag_start
(volinfo, err_str, sizeof (err_str),
- GF_DEFRAG_CMD_START_FORCE,
+ defrag_cmd,
glusterd_remove_brick_migrate_cbk, GD_OP_REMOVE_BRICK);
if (!ret)