]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: After repairs finish a new deep-scrub should be avoided
authorDavid Zafman <david.zafman@inktank.com>
Wed, 15 May 2013 02:22:18 +0000 (19:22 -0700)
committerDavid Zafman <david.zafman@inktank.com>
Thu, 16 May 2013 00:18:01 +0000 (17:18 -0700)
When errors fixed, clear them so pg not inconsistent and no deep-scrub needed
In the rare case of incomplete repair, still do deep-scrub to get new error counts

fixes: #4783

Signed-off-by: David Zafman <david.zafman@inktank.com>
src/osd/PG.cc

index 4aac5301ab9b24011cb8bdd82272ca021b37e04e..fdc5701bc87e4ff5a50154665ce8ce5dbd0d14b5 100644 (file)
@@ -4611,7 +4611,6 @@ 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();
@@ -4716,6 +4715,17 @@ void PG::scrub_finish() {
     info.history.last_deep_scrub = info.last_update;
     info.history.last_deep_scrub_stamp = now;
   }
+  // Since we don't know which errors were fixed, we can only clear them
+  // when every one has been fixed.
+  if (repair) {
+    if (scrubber.fixed == scrubber.shallow_errors + scrubber.deep_errors) {
+      assert(deep_scrub);
+      scrubber.shallow_errors = scrubber.deep_errors = 0;
+    } else {
+      // Deep scrub in order to get corrected error counts
+      scrub_after_recovery = true;
+    }
+  }
   if (deep_scrub) {
     if ((scrubber.shallow_errors == 0) && (scrubber.deep_errors == 0))
       info.history.last_clean_scrub_stamp = now;