]> 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, 9 Jan 2013 02:32:38 +0000 (18:32 -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>
Reviewed-by: Samuel Just <sam.just@inktank.com>
src/osd/ReplicatedPG.cc

index cbae003827c6802a21eaf01cfae89e178f22f22d..e8a68fed512e17466d56f2bdc662389459c3da1a 100644 (file)
@@ -7108,10 +7108,15 @@ void ReplicatedPG::_scrub(ScrubMap& scrubmap)
       }
     } 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;