]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix rescrub after repair
authorSage Weil <sage@inktank.com>
Tue, 15 Jan 2013 02:31:06 +0000 (18:31 -0800)
committerSage Weil <sage@inktank.com>
Wed, 23 Jan 2013 14:21:32 +0000 (06:21 -0800)
We were rescrubbing if INCONSISTENT is set, but that is now persistent.
Add a new scrub_after_recovery flag that is reset on each peering interval
and set that when repair encounters errors.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit a586966a3cfb10b5ffec0e9140053a7e4ff105d2)

src/osd/PG.cc
src/osd/PG.h

index ff0fa2014ca695fe9ebd64659c468b93a51d85c2..0a5460b9fa5d02c01deeecc0d42b5c9d028be47e 100644 (file)
@@ -82,6 +82,7 @@ PG::PG(OSDService *o, OSDMapRef curmap,
   pg_stats_valid(false),
   osr(osd->osr_registry.lookup_or_create(p, (stringify(p)))),
   finish_sync_event(NULL),
+  scrub_after_recovery(false),
   active_pushes(0),
   recovery_state(this)
 {
@@ -1024,6 +1025,8 @@ void PG::clear_primary_state()
   log.reset_recovery_pointers();
 
   scrubber.reserved_peers.clear();
+  scrub_after_recovery = false;
+
   osd->recovery_wq.dequeue(this);
   osd->snap_trim_wq.dequeue(this);
 }
@@ -1873,8 +1876,9 @@ void PG::_finish_recovery(Context *c)
 
     update_stats();
 
-    if (state_test(PG_STATE_INCONSISTENT)) {
+    if (scrub_after_recovery) {
       dout(10) << "_finish_recovery requeueing for scrub" << dendl;
+      scrub_after_recovery = false;
       queue_scrub();
     }
   } else {
@@ -4209,6 +4213,7 @@ void PG::scrub_process_inconsistent() {
     osd->clog.error(ss);
     if (repair) {
       state_clear(PG_STATE_CLEAN);
+      scrub_after_recovery = true;
       for (map<hobject_t, pair<ScrubMap::object, int> >::iterator i =
             scrubber.authoritative.begin();
           i != scrubber.authoritative.end();
index 9d5983ef94ae3fca92ecee35985bd029303b2105..58b9de78fd5b12366be4cccf2f5209ff365967c1 100644 (file)
@@ -951,6 +951,8 @@ public:
 
   } scrubber;
 
+  bool scrub_after_recovery;
+
   int active_pushes;
 
   void repair_object(const hobject_t& soid, ScrubMap::object *po, int bad_peer, int ok_peer);