From 19e44bff37c0f772cac8e6a04b7979c209f34489 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 20 Dec 2012 22:01:34 -0800 Subject: [PATCH] osd: clear scrub state if queued scrub doesn't start 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 --- src/osd/PG.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index aab54f862225f..c5566a1bf4151 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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; } -- 2.39.5