From: Sage Weil Date: Fri, 1 Feb 2019 18:43:03 +0000 (-0600) Subject: Merge PR #25703 into master X-Git-Tag: v14.1.0~227 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=54fd6dce26bd5aa518a2955d9ae04c6d6c839743;p=ceph-ci.git Merge PR #25703 into master * 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 --- 54fd6dce26bd5aa518a2955d9ae04c6d6c839743 diff --cc src/mon/PGMap.cc index d1fb6bbf27a,a6f4c46230e..ed39d955ef5 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@@ -2939,30 -2939,70 +2939,74 @@@ void PGMap::get_health_checks } } + // OBJECT_STORE_WARN + if (osd_sum.os_alerts.size()) { + map>> 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 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 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 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 "