]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Merge PR #25703 into master
authorSage Weil <sage@redhat.com>
Fri, 1 Feb 2019 18:43:03 +0000 (12:43 -0600)
committerSage Weil <sage@redhat.com>
Fri, 1 Feb 2019 18:43:03 +0000 (12:43 -0600)
* refs/pull/25703/head:
os/bluestore: option to disable bluestore warns on spillover.
mon: expose object store health warnings
osd: expose object store alerts
os/bluestore: indicate BlueFS spillover and lacking compressor alerts
os:enable ObjectStore::statfs() api to return OS alert list.

Reviewed-by: Sage Weil <sage@redhat.com>
1  2 
src/common/legacy_config_opts.h
src/common/options.cc
src/mon/PGMap.cc
src/os/memstore/MemStore.cc
src/os/memstore/MemStore.h
src/osd/OSD.cc

Simple merge
Simple merge
index d1fb6bbf27ab1a90eaa1a4928780715afdca97b0,a6f4c46230e9ad06dddf92307c97e70c98d91372..ed39d955ef5caf41a4a420f7a4b7fb184d5dbbc3
@@@ -2939,30 -2939,70 +2939,74 @@@ void PGMap::get_health_checks
      }
    }
  
+   // OBJECT_STORE_WARN
+   if (osd_sum.os_alerts.size()) {
+     map<string, pair<size_t, list<string>>> os_alerts_sum;
+     for (auto& a : osd_sum.os_alerts) {
+       int left = max;
+       string s0 = " osd:";
+       s0 += stringify(a.first);
+       for (auto& aa : a.second) {
+         string s(s0);
+         s += " ";
+         s += aa.second;
+         auto it = os_alerts_sum.find(aa.first);
+         if (it == os_alerts_sum.end()) {
+           list<string> d;
+           d.emplace_back(s);
+           os_alerts_sum.emplace(aa.first, std::make_pair(1, d));
+         } else {
+           auto& p = it->second;
+           ++p.first;
+           p.second.emplace_back(s);
+         }
+       if (--left == 0) {
+         break;
+       }
+       }
+     }
+     for (auto& asum : os_alerts_sum) {
+       string summary;
+       if (asum.first == "BLUEFS_SPILLOVER") {
+       summary = "BlueFS spillover detected";
+       } else if (asum.first == "BLUESTORE_NO_COMPRESSION") {
+       summary = "BlueStore compression broken";
+       }
+       summary += " on ";
+       summary += stringify(asum.second.first);
+       summary += " OSD(s)";
+       auto& d = checks->add(asum.first, HEALTH_WARN, summary);
+       for (auto& s : asum.second.second) {
+         d.detail.push_back(s);
+       }
+     }
+   }
    // PG_NOT_SCRUBBED
    // PG_NOT_DEEP_SCRUBBED
 -  {
 -    if (cct->_conf->mon_warn_not_scrubbed ||
 -        cct->_conf->mon_warn_not_deep_scrubbed) {
 -      list<string> detail, deep_detail;
 -      int detail_max = max, deep_detail_max = max;
 -      int detail_more = 0, deep_detail_more = 0;
 -      int detail_total = 0, deep_detail_total = 0;
 -      const double age = cct->_conf->mon_warn_not_scrubbed +
 -        cct->_conf->mon_scrub_interval;
 -      utime_t cutoff = now;
 -      cutoff -= age;
 -      const double deep_age = cct->_conf->mon_warn_not_deep_scrubbed +
 -        cct->_conf->osd_deep_scrub_interval;
 -      utime_t deep_cutoff = now;
 -      deep_cutoff -= deep_age;
 -      for (auto& p : pg_stat) {
 -        if (cct->_conf->mon_warn_not_scrubbed &&
 -            p.second.last_scrub_stamp < cutoff) {
 +  if (cct->_conf->mon_warn_pg_not_scrubbed_ratio ||
 +        cct->_conf->mon_warn_pg_not_deep_scrubbed_ratio) {
 +    list<string> detail, deep_detail;
 +    int detail_max = max, deep_detail_max = max;
 +    int detail_more = 0, deep_detail_more = 0;
 +    int detail_total = 0, deep_detail_total = 0;
 +    for (auto& p : pg_stat) {
 +      int64_t pnum =  p.first.pool();
 +      auto pool = osdmap.get_pg_pool(pnum);
 +      if (!pool)
 +        continue;
 +      if (cct->_conf->mon_warn_pg_not_scrubbed_ratio) {
 +        double scrub_max_interval = 0;
 +        pool->opts.get(pool_opts_t::SCRUB_MAX_INTERVAL, &scrub_max_interval);
 +        if (scrub_max_interval <= 0) {
 +          scrub_max_interval = cct->_conf->osd_scrub_max_interval;
 +        }
 +        const double age = (cct->_conf->mon_warn_pg_not_scrubbed_ratio * scrub_max_interval) +
 +          scrub_max_interval;
 +        utime_t cutoff = now;
 +        cutoff -= age;
 +        if (p.second.last_scrub_stamp < cutoff) {
            if (detail_max > 0) {
              ostringstream ss;
              ss << "pg " << p.first << " not scrubbed since "
Simple merge
Simple merge
diff --cc src/osd/OSD.cc
Simple merge