]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: make missing head non-fatal during scrub
authorSage Weil <sage@inktank.com>
Wed, 2 Jan 2013 17:39:26 +0000 (09:39 -0800)
committerSage Weil <sage@inktank.com>
Wed, 16 Jan 2013 03:21:09 +0000 (19:21 -0800)
If we encounter a scrub without a preceeding head, warn instead of
crashing.  Note that this is still something we can't repair.

See #3705.

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

index 6446717e2a5b24af646eaa19a3c98ca1d1d02d19..3caa8cd4dce70ea790d32d4893a95b125842cd48 100644 (file)
@@ -6563,10 +6563,15 @@ int ReplicatedPG::_scrub(ScrubMap& scrubmap, int& errors, int& fixed)
       }
     } else if (soid.snap) {
       // it's a clone
-      assert(head != hobject_t());
-
       stat.num_object_clones++;
       
+      if (head == hobject_t()) {
+       osd->clog.error() << mode << " " << info.pgid << " " << soid
+                         << " found clone without head";
+       ++errors;
+       continue;
+      }
+
       if (soid.snap != *curclone) {
        osd->clog.error() << mode << " " << info.pgid << " " << soid
                          << " expected clone " << *curclone;