From: Ning Yao Date: Mon, 21 Sep 2015 02:05:26 +0000 (+0800) Subject: Fix unneccessary at/near max target warn in ceph -s when using ecpool X-Git-Tag: v9.1.0~71^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F5959%2Fhead;p=ceph.git 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 --- 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) {