From 444378de64f398c4e19468e83ac31fccc0a94800 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Thu, 4 Feb 2016 18:24:55 +0530 Subject: cluster/tier : Fixed wrong variable comparison The wrong variable was being checked to determine the watermark value. Change-Id: If4c97fa70b772187f1fcbdf5193e077cb356a8b1 BUG: 1303895 Signed-off-by: N Balachandran Reviewed-on: http://review.gluster.org/13357 Smoke: Gluster Build System Reviewed-by: Dan Lambright NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System --- xlators/cluster/dht/src/tier.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'xlators/cluster/dht/src') diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c index ce11fa7d7ca..0a74e063824 100644 --- a/xlators/cluster/dht/src/tier.c +++ b/xlators/cluster/dht/src/tier.c @@ -332,6 +332,17 @@ exit: return ret; } + +static gf_boolean_t +is_hot_tier_full (gf_tier_conf_t *tier_conf) +{ + if (tier_conf && (tier_conf->mode == TIER_MODE_WM) && + (tier_conf->watermark_last == TIER_WM_HI)) + return _gf_true; + + return _gf_false; +} + int tier_do_migration (xlator_t *this, int promote, loc_t *root_loc) { @@ -448,6 +459,7 @@ tier_migrate_using_query_file (void *_args) int total_time = 0; int max_time = 0; + GF_VALIDATE_OR_GOTO ("tier", query_cbk_args, out); GF_VALIDATE_OR_GOTO ("tier", query_cbk_args->this, out); this = query_cbk_args->this; @@ -458,7 +470,6 @@ tier_migrate_using_query_file (void *_args) conf = this->private; defrag = query_cbk_args->defrag; - migrate_data = dict_new (); if (!migrate_data) goto out; @@ -542,7 +553,7 @@ tier_migrate_using_query_file (void *_args) * a chance to start if not already running*/ if (query_cbk_args->is_promotion && - defrag->tier_conf.mode == TIER_WM_HI) { + is_hot_tier_full (&defrag->tier_conf)) { gf_msg (this->name, GF_LOG_INFO, 0, DHT_MSG_LOG_TIER_STATUS, @@ -554,7 +565,6 @@ tier_migrate_using_query_file (void *_args) continue; } - if (!list_empty (&query_record->link_list)) { per_file_status = dict_set_str (migrate_data, @@ -1614,6 +1624,8 @@ tier_check_promote (gf_tier_conf_t *tier_conf, } + + void clear_bricklist (struct list_head *brick_list) { -- cgit