]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix unneccessary at/near max target warn in ceph -s when using ecpool 5959/head
authorNing Yao <zay11022@gmail.com>
Mon, 21 Sep 2015 02:05:26 +0000 (10:05 +0800)
committerNing Yao <zay11022@gmail.com>
Mon, 21 Sep 2015 02:05:26 +0000 (10:05 +0800)
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 <zay11022@gmail.com>
src/mon/PGMonitor.cc

index 3225ef629d89358392f39fb5ffbd420c92324dd8..726d0a6fedb5d2e8d116225c9e3effa24bd2f40e 100644 (file)
@@ -2122,7 +2122,7 @@ void PGMonitor::get_health(list<pair<health_status_t,string> >& 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<pair<health_status_t,string> >& 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) {