From: David Zafman Date: Sat, 9 Mar 2013 04:23:21 +0000 (-0800) Subject: Add code to check flag state X-Git-Tag: v0.60~105^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3fbdfd30e0d9a555f1d6748b5212173260fbcefc;p=ceph.git Add code to check flag state Signed-off-by: David Zafman --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 90e6c0fcd5db..b125110879b7 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); }