summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2016-02-04 18:24:55 +0530
committerDan Lambright <dlambrig@redhat.com>2016-02-10 22:25:42 -0800
commit444378de64f398c4e19468e83ac31fccc0a94800 (patch)
tree0824940ef0164286b4f94f93bce1ded0517df19c /xlators
parente501a7da4c50e2a2049a71119c25ed43b43f3395 (diff)
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 <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/13357 Smoke: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/dht/src/tier.c18
1 files changed, 15 insertions, 3 deletions
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)
{