From b41f5746cad5b7d28a24b2c543d32294f6664aaa Mon Sep 17 00:00:00 2001 From: Ning Yao Date: Mon, 21 Sep 2015 10:05:26 +0800 Subject: [PATCH] Fix unneccessary at/near max target warn in ceph -s when using ecpool When calculated objects needing eviction, we use object - hitset_achieve. So setting max objects = 30000, ceph -s will warn you at/near if there exists hitset_achieve Signed-off-by: Ning Yao --- src/mon/PGMonitor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index 3225ef629d89..726d0a6fedb5 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -2122,7 +2122,7 @@ void PGMonitor::get_health(list >& summary, uint64_t ratio = p->second.cache_target_full_ratio_micro + ((1000000 - p->second.cache_target_full_ratio_micro) * g_conf->mon_cache_target_full_warn_ratio); - if (p->second.target_max_objects && (uint64_t)st.stats.sum.num_objects > + if (p->second.target_max_objects && (uint64_t)(st.stats.sum.num_objects - st.stats.sum.num_objects_hit_set_archive) > p->second.target_max_objects * (ratio / 1000000.0)) { nearfull = true; if (detail) { @@ -2134,7 +2134,7 @@ void PGMonitor::get_health(list >& summary, detail->push_back(make_pair(HEALTH_WARN, ss.str())); } } - if (p->second.target_max_bytes && (uint64_t)st.stats.sum.num_bytes > + if (p->second.target_max_bytes && (uint64_t)(st.stats.sum.num_bytes - st.stats.sum.num_bytes_hit_set_archive) > p->second.target_max_bytes * (ratio / 1000000.0)) { nearfull = true; if (detail) { -- 2.47.3