From: Sage Weil Date: Tue, 25 Jul 2017 15:33:42 +0000 (-0400) Subject: mon/OSDMonitor: remove dead health check code X-Git-Tag: v12.1.2~48^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b562f0686c3b02e756a211eb3dca5839e339a908;p=ceph.git mon/OSDMonitor: remove dead health check code get_health() is only called pre-luminous; luminous+ health checks go in OSDMap::get_health_checks() or PGMap::get_health_checks(). Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 9088ea21881f..ac8178130fd5 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -3633,137 +3633,6 @@ void OSDMonitor::get_health(list >& summary, } } - if (osdmap.require_osd_release >= CEPH_RELEASE_LUMINOUS) { - // An osd could configure failsafe ratio, to something different - // but for now assume it is the same here. - float fsr = g_conf->osd_failsafe_full_ratio; - if (fsr > 1.0) fsr /= 100; - float fr = osdmap.get_full_ratio(); - float br = osdmap.get_backfillfull_ratio(); - float nr = osdmap.get_nearfull_ratio(); - - bool out_of_order = false; - // These checks correspond to how OSDService::check_full_status() in an OSD - // handles the improper setting of these values. - if (br < nr) { - out_of_order = true; - if (detail) { - ostringstream ss; - ss << "backfillfull_ratio (" << br << ") < nearfull_ratio (" << nr << "), increased"; - detail->push_back(make_pair(HEALTH_ERR, ss.str())); - } - br = nr; - } - if (fr < br) { - out_of_order = true; - if (detail) { - ostringstream ss; - ss << "full_ratio (" << fr << ") < backfillfull_ratio (" << br << "), increased"; - detail->push_back(make_pair(HEALTH_ERR, ss.str())); - } - fr = br; - } - if (fsr < fr) { - out_of_order = true; - if (detail) { - ostringstream ss; - ss << "osd_failsafe_full_ratio (" << fsr << ") < full_ratio (" << fr << "), increased"; - detail->push_back(make_pair(HEALTH_ERR, ss.str())); - } - } - if (out_of_order) { - ostringstream ss; - ss << "Full ratio(s) out of order"; - summary.push_back(make_pair(HEALTH_ERR, ss.str())); - } - - set full, backfillfull, nearfull; - osdmap.get_full_osd_counts(&full, &backfillfull, &nearfull); - if (full.size()) { - ostringstream ss; - ss << full.size() << " full osd(s)"; - summary.push_back(make_pair(HEALTH_ERR, ss.str())); - } - if (backfillfull.size()) { - ostringstream ss; - ss << backfillfull.size() << " backfillfull osd(s)"; - summary.push_back(make_pair(HEALTH_WARN, ss.str())); - } - if (nearfull.size()) { - ostringstream ss; - ss << nearfull.size() << " nearfull osd(s)"; - summary.push_back(make_pair(HEALTH_WARN, ss.str())); - } - if (detail) { - for (auto& i: full) { - ostringstream ss; - ss << "osd." << i << " is full"; - detail->push_back(make_pair(HEALTH_ERR, ss.str())); - } - for (auto& i: backfillfull) { - ostringstream ss; - ss << "osd." << i << " is backfill full"; - detail->push_back(make_pair(HEALTH_WARN, ss.str())); - } - for (auto& i: nearfull) { - ostringstream ss; - ss << "osd." << i << " is near full"; - detail->push_back(make_pair(HEALTH_WARN, ss.str())); - } - } - - // warn if there is any noup osds. - vector noup_osds; - osdmap.get_noup_osds(&noup_osds); - if (noup_osds.size()) { - ostringstream ss; - ss << noup_osds.size() << " noup osd(s)"; - summary.push_back(make_pair(HEALTH_WARN, ss.str())); - if (detail) { - ss << ": " << noup_osds; - detail->push_back(make_pair(HEALTH_WARN, ss.str())); - } - } - - // warn if there is any nodown osds. - vector nodown_osds; - osdmap.get_nodown_osds(&nodown_osds); - if (nodown_osds.size()) { - ostringstream ss; - ss << nodown_osds.size() << " nodown osd(s)"; - summary.push_back(make_pair(HEALTH_WARN, ss.str())); - if (detail) { - ss << ": " << nodown_osds; - detail->push_back(make_pair(HEALTH_WARN, ss.str())); - } - } - - // warn if there is any noin osds. - vector noin_osds; - osdmap.get_noin_osds(&noin_osds); - if (noin_osds.size()) { - ostringstream ss; - ss << noin_osds.size() << " noin osd(s)"; - summary.push_back(make_pair(HEALTH_WARN, ss.str())); - if (detail) { - ss << ": " << noin_osds; - detail->push_back(make_pair(HEALTH_WARN, ss.str())); - } - } - - // warn if there is any noout osds. - vector noout_osds; - osdmap.get_noout_osds(&noout_osds); - if (noout_osds.size()) { - ostringstream ss; - ss << noout_osds.size() << " noout osd(s)"; - summary.push_back(make_pair(HEALTH_WARN, ss.str())); - if (detail) { - ss << ": " << noout_osds; - detail->push_back(make_pair(HEALTH_WARN, ss.str())); - } - } - } // note: we leave it to ceph-mgr to generate details health warnings // with actual osd utilizations @@ -3925,31 +3794,6 @@ void OSDMonitor::get_health(list >& summary, if (detail) detail->push_back(make_pair(HEALTH_WARN, ss.str())); } - - const string& pool_name = osdmap.get_pool_name(it.first); - const pool_stat_t *pstat = mon->pgservice->get_pool_stat(it.first); - if (pstat == nullptr) { - continue; - } - const object_stat_sum_t& sum = pstat->stats.sum; - - // application metadata is not encoded until luminous is minimum - // required release - if (osdmap.require_osd_release >= CEPH_RELEASE_LUMINOUS && - sum.num_objects > 0 && pool.application_metadata.empty() && - !pool.is_tier() && !g_conf->mon_debug_no_require_luminous) { - stringstream ss; - ss << "application not enabled on pool '" << pool_name << "'"; - - summary.push_back({HEALTH_WARN, ss.str()}); - if (detail) { - ss << "; " - << "use 'ceph osd pool application enable " - << "', where is 'cephfs', 'rbd', 'rgw', " - << "or freeform for custom applications."; - detail->push_back({HEALTH_WARN, ss.str()}); - } - } } } }