summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/dht/src')
-rw-r--r--xlators/cluster/dht/src/tier.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c
index 28f08fed332..e716dde35ab 100644
--- a/xlators/cluster/dht/src/tier.c
+++ b/xlators/cluster/dht/src/tier.c
@@ -335,6 +335,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)
{
@@ -447,6 +458,7 @@ tier_migrate_using_query_file (void *_args)
int total_files = 0;
loc_t root_loc = { 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;
@@ -519,7 +531,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,
@@ -531,7 +543,6 @@ tier_migrate_using_query_file (void *_args)
continue;
}
-
if (!list_empty (&query_record->link_list)) {
per_file_status =
dict_set_str (migrate_data,
@@ -1585,6 +1596,8 @@ tier_check_promote (gf_tier_conf_t *tier_conf,
}
+
+
void
clear_bricklist (struct list_head *brick_list)
{