From 204115c58622b5a15e1de8b6a909d77fdb49a226 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Mon, 25 Jan 2016 13:27:42 +0530 Subject: cluster/tier: Ignore quota-deem-statfs for watermark calculation The tier process watermark calculations were incorrect when the quota-deem-statfs option was enabled. We now ignore this while calculating hot tier usage to determine watermark levels. Change-Id: I308bc24432e2fa5ad1d5703e80fc391433538bbb BUG: 1302012 > Signed-off-by: N Balachandran > Reviewed-on: http://review.gluster.org/13288 > Smoke: Gluster Build System > Reviewed-by: mohammed rafi kc > Tested-by: mohammed rafi kc > CentOS-regression: Gluster Build System > Reviewed-by: Dan Lambright > NetBSD-regression: NetBSD Build System > Tested-by: Dan Lambright (cherry picked from commit 9ce86c63e349eaafbd923b0b541d75e929ecbae7) Signed-off-by: Nithya Balachandran Reviewed-on: http://review.gluster.org/13292 Reviewed-by: Pranith Kumar Karampuri Tested-by: Pranith Kumar Karampuri Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System --- xlators/cluster/dht/src/tier.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'xlators/cluster') diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c index f8c854e0099..63419d79db8 100644 --- a/xlators/cluster/dht/src/tier.c +++ b/xlators/cluster/dht/src/tier.c @@ -153,6 +153,25 @@ tier_check_watermark (xlator_t *this, loc_t *root_loc) goto exit; } + xdata = dict_new (); + if (!xdata) { + gf_msg (this->name, GF_LOG_ERROR, ENOMEM, + DHT_MSG_NO_MEMORY, + "failed to allocate dictionary"); + ret = -1; + goto exit; + } + + ret = dict_set_int8 (xdata, GF_INTERNAL_IGNORE_DEEM_STATFS, 1); + if (ret) { + gf_msg (this->name, GF_LOG_ERROR, 0, + DHT_MSG_DICT_SET_FAILED, + "Failed to set " + GF_INTERNAL_IGNORE_DEEM_STATFS" in dict"); + ret = -1; + goto exit; + } + /* Find how much free space is on the hot subvolume. Then see if that value */ /* is less than or greater than user defined watermarks. Stash results in */ /* the tier_conf data structure. */ @@ -193,6 +212,8 @@ tier_check_watermark (xlator_t *this, loc_t *root_loc) } exit: + if (xdata) + dict_unref (xdata); return ret; } -- cgit