From: Sage Weil Date: Wed, 12 Jul 2017 13:17:55 +0000 (-0400) Subject: mon/PGMap: adjust scrub checks to avoid overflow for future stamps X-Git-Tag: v12.1.1~58^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F15643%2Fhead;p=ceph.git mon/PGMap: adjust scrub checks to avoid overflow for future stamps Avoid an overflow (and false warning) when scrub stamps are in the future. Signed-off-by: Sage Weil --- diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index ac42d3a74764..913e035f7ef2 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -3181,20 +3181,22 @@ void PGMap::get_health_checks( // PG_NOT_DEEP_SCRUBBED { list detail, deep_detail; - const int age = cct->_conf->mon_warn_not_scrubbed + + const double age = cct->_conf->mon_warn_not_scrubbed + cct->_conf->mon_scrub_interval; - const int deep_age = cct->_conf->mon_warn_not_deep_scrubbed + + 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) { - const utime_t time_since_ls = now - p.second.last_scrub_stamp; - if (time_since_ls > age) { + if (p.second.last_scrub_stamp < cutoff) { ostringstream ss; ss << "pg " << p.first << " not scrubbed since " << p.second.last_scrub_stamp; detail.push_back(ss.str()); } - const utime_t time_since_lds = now - p.second.last_deep_scrub_stamp; - if (time_since_lds > deep_age) { + if (p.second.last_deep_scrub_stamp < deep_cutoff) { ostringstream ss; ss << "pg " << p.first << " not deep-scrubbed since " << p.second.last_deep_scrub_stamp;