]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMonitor: skip scrub checking if we can
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 17 Aug 2016 03:22:38 +0000 (11:22 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 18 Aug 2016 10:05:40 +0000 (18:05 +0800)
The PG-scrub checking may become expensive once the cluster
is big. Since the scrub-warn related options are defaulted to be off,
we should skip this checking when it is possible, which
is good for performance.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/mon/PGMonitor.cc

index a9e1f16627dcd6be21261d78cb24da823977c8d3..04c75e59d5824c598937453a68feec35216fce86 100644 (file)
@@ -2127,6 +2127,10 @@ namespace {
                            list<pair<health_status_t,string> > &summary,
                            list<pair<health_status_t,string> > *detail,
                            const CephContext* cct) {
+    if (cct->_conf->mon_warn_not_scrubbed == 0 &&
+      cct->_conf->mon_warn_not_deep_scrubbed == 0)
+      return;
+
     int pgs_count = 0;
     const utime_t now = ceph_clock_now(nullptr);
     for (const auto& pg_entry : pg_stats) {