]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: clear scrub state if queued scrub doesn't start
authorSage Weil <sage@inktank.com>
Fri, 21 Dec 2012 06:01:34 +0000 (22:01 -0800)
committerSage Weil <sage@inktank.com>
Fri, 21 Dec 2012 19:29:47 +0000 (11:29 -0800)
We set SCRUBBING when we queue a pg for scrub.  If we dequeue and
call scrub() but abort for some reason (!active, degraded, etc.), clear
that state bit.

Bug is easily reproduced with 'ceph osd scrub N' during cluster startup
when PGs are peering; some PGs can get left in the scrubbing state.

Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/PG.cc

index aab54f862225f9e4768e4d8ac4de52eec6a36cfa..c5566a1bf41511a60e5ca682630abff4721fe927 100644 (file)
@@ -3535,6 +3535,10 @@ void PG::scrub()
 
   if (!is_primary() || !is_active() || !is_clean() || !is_scrubbing()) {
     dout(10) << "scrub -- not primary or active or not clean" << dendl;
+    state_clear(PG_STATE_SCRUBBING);
+    state_clear(PG_STATE_REPAIR);
+    state_clear(PG_STATE_DEEP_SCRUB);
+    update_stats();
     unlock();
     return;
   }