From 3fbdfd30e0d9a555f1d6748b5212173260fbcefc Mon Sep 17 00:00:00 2001 From: David Zafman Date: Fri, 8 Mar 2013 20:23:21 -0800 Subject: [PATCH] Add code to check flag state Signed-off-by: David Zafman --- src/osd/PG.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 90e6c0fcd5d..b125110879b 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2857,6 +2857,21 @@ bool PG::sched_scrub() return false; } + bool time_for_deep = (ceph_clock_now(g_ceph_context) > + info.history.last_deep_scrub_stamp + g_conf->osd_deep_scrub_interval); + + //NODEEP_SCRUB so ignore time initiated deep-scrub + if (osd->osd->get_osdmap()->test_flag(CEPH_OSDMAP_NODEEP_SCRUB)) + time_for_deep = false; + + if (!scrubber.must_scrub) { + assert(!scrubber.must_deep_scrub); + + //NOSCRUB so skip regular scrubs + if (osd->osd->get_osdmap()->test_flag(CEPH_OSDMAP_NOSCRUB) && !time_for_deep) + return false; + } + bool ret = true; if (!scrubber.reserved) { assert(scrubber.reserved_peers.empty()); @@ -2878,8 +2893,7 @@ bool PG::sched_scrub() ret = false; } else if (scrubber.reserved_peers.size() == acting.size()) { dout(20) << "sched_scrub: success, reserved self and replicas" << dendl; - if (ceph_clock_now(g_ceph_context) > - info.history.last_deep_scrub_stamp + g_conf->osd_deep_scrub_interval) { + if (time_for_deep) { dout(10) << "sched_scrub: scrub will be deep" << dendl; state_set(PG_STATE_DEEP_SCRUB); }