]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG::sched_scrub: only set PG_STATE_DEEP_SCRUB once reserved
authorSamuel Just <sam.just@inktank.com>
Fri, 21 Dec 2012 19:36:04 +0000 (11:36 -0800)
committerSamuel Just <sam.just@inktank.com>
Fri, 21 Dec 2012 19:36:54 +0000 (11:36 -0800)
Otherwise we would have +DEEP before we have +SCRUB.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc

index 04beea73b16778f23c2a675fdd096700218698b3..036cca5e94771f4dc88b7f01341a551511d3ed4e 100644 (file)
@@ -3011,11 +3011,6 @@ bool PG::sched_scrub()
     return false;
   }
 
-  if (ceph_clock_now(g_ceph_context) > info.history.last_deep_scrub_stamp + g_conf->osd_deep_scrub_interval) {
-    dout(10) << "sched_scrub: scrub will be deep" << dendl;
-    state_set(PG_STATE_DEEP_SCRUB);
-  }
-
   bool ret = true;
   if (!scrubber.reserved) {
     assert(scrubber.reserved_peers.empty());
@@ -3037,6 +3032,11 @@ 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) {
+       dout(10) << "sched_scrub: scrub will be deep" << dendl;
+       state_set(PG_STATE_DEEP_SCRUB);
+      }
       queue_scrub();
     } else {
       // none declined, since scrubber.reserved is set