From: David Zafman Date: Fri, 7 Jun 2019 03:32:40 +0000 (+0000) Subject: osd: Don't randomize deep scrubs when noscrub set X-Git-Tag: v14.2.3~161^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F28768%2Fhead;p=ceph.git osd: Don't randomize deep scrubs when noscrub set Fixes: http://tracker.ceph.com/issues/40198 Signed-off-by: David Zafman (cherry picked from commit 974e374eb33b211e9630e1bc572da8fb50a806c9) --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index e54827611ca..7d762961489 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -4367,7 +4367,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;