]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: Don't randomize deep scrubs when noscrub set
authorDavid Zafman <dzafman@redhat.com>
Fri, 7 Jun 2019 03:32:40 +0000 (03:32 +0000)
committerDavid Zafman <dzafman@redhat.com>
Fri, 7 Jun 2019 23:32:51 +0000 (23:32 +0000)
Fixes: http://tracker.ceph.com/issues/40198
Signed-off-by: David Zafman <dzafman@redhat.com>
src/osd/PG.cc

index 4a1d5fc79df3353d2e7a6b15dee68469fbf43d5d..aa26a1863606461df9249349d342f69eca9a5cd4 100644 (file)
@@ -1334,7 +1334,11 @@ bool PG::sched_scrub()
 
   bool deep_coin_flip = false;
   // Only add random deep scrubs when NOT user initiated scrub
-  if (!scrubber.must_scrub)
+  // If we randomize when noscrub set then it guarantees
+  // we will deep scrub because this function is called often.
+  if (!time_for_deep && !scrubber.must_scrub
+       && !(get_osdmap()->test_flag(CEPH_OSDMAP_NOSCRUB)
+           || pool.info.has_flag(pg_pool_t::FLAG_NOSCRUB)))
       deep_coin_flip = (rand() % 100) < cct->_conf->osd_deep_scrub_randomize_ratio * 100;
   dout(20) << __func__ << ": time_for_deep=" << time_for_deep << " deep_coin_flip=" << deep_coin_flip << dendl;