]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: handle snapdir properly during scrub
authorSage Weil <sage@inktank.com>
Tue, 1 Apr 2014 18:04:47 +0000 (11:04 -0700)
committerSage Weil <sage@inktank.com>
Tue, 1 Apr 2014 18:04:47 +0000 (11:04 -0700)
Handle snapdir similarly to how head is treated when updating the
next_clone info.  Also, add a warning when we have a snapdir object and
head_exists == true (the converse of the existing check).

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

index 27528c846430e8306ffbcaa8e85c99c407ef8410..226ff43e81e6682492342ffd58b07ecbd8c916f4 100644 (file)
@@ -11176,10 +11176,16 @@ void ReplicatedPG::_scrub(ScrubMap& scrubmap)
       ++scrubber.shallow_errors;
     }
 
-    if (soid.snap == CEPH_NOSNAP) {
-      if (!snapset.head_exists) {
+    if (soid.snap == CEPH_NOSNAP || soid.snap == CEPH_SNAPDIR) {
+      if (soid.snap == CEPH_NOSNAP && !snapset.head_exists) {
+       osd->clog.error() << mode << " " << info.pgid << " " << soid
+                         << " snapset.head_exists=false, but head exists";
+        ++scrubber.shallow_errors;
+       continue;
+      }
+      if (soid.snap == CEPH_SNAPDIR && snapset.head_exists) {
        osd->clog.error() << mode << " " << info.pgid << " " << soid
-                         << " snapset.head_exists=false, but object exists";
+                         << " snapset.head_exists=true, but snapdir exists";
         ++scrubber.shallow_errors;
        continue;
       }