]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: tolerate missing clones in cache pools 1547/head
authorSage Weil <sage@inktank.com>
Thu, 27 Mar 2014 22:12:25 +0000 (15:12 -0700)
committerSage Weil <sage@inktank.com>
Thu, 27 Mar 2014 22:12:25 +0000 (15:12 -0700)
A few cases:

- As we are working through the list, if we see a clone that is lower than
  the next one we were expecting, we should be able to skip them.
- If we see a head, we can skip all of the rest of the clones.
- If we get to the end and next_clone was set, we can ignore it.

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

index 53c877a2929976bc9be3ed062e02393fbaad9864..0d0db5f572a62352915abca238de7537afbb193b 100644 (file)
@@ -11123,6 +11123,26 @@ void ReplicatedPG::_scrub(ScrubMap& scrubmap)
     //assert(data.length() == p->size);
     //
 
+    if (!next_clone.is_min() && next_clone != soid &&
+       pool.info.cache_mode == pg_pool_t::CACHEMODE_NONE) {
+      // it is okay to be missing one or more clones in a cache tier.
+      // skip higher-numbered clones in the list.
+      while (curclone != snapset.clones.rend() &&
+            soid.snap < *curclone)
+       ++curclone;
+      if (curclone != snapset.clones.rend() &&
+         soid.snap == *curclone) {
+       dout(20) << __func__ << " skipped some clones in cache tier" << dendl;
+       next_clone.snap = *curclone;
+      }
+      if (curclone == snapset.clones.rend() ||
+         soid.snap == CEPH_NOSNAP) {
+       dout(20) << __func__ << " skipped remaining clones in cache tier"
+                << dendl;
+       next_clone = hobject_t();
+       head = hobject_t();
+      }
+    }
     if (!next_clone.is_min() && next_clone != soid) {
       osd->clog.error() << mode << " " << info.pgid << " " << soid
                        << " expected clone " << next_clone;
@@ -11187,7 +11207,8 @@ void ReplicatedPG::_scrub(ScrubMap& scrubmap)
     scrub_cstat.add(stat, cat);
   }
 
-  if (!next_clone.is_min()) {
+  if (!next_clone.is_min() &&
+      pool.info.cache_mode == pg_pool_t::CACHEMODE_NONE) {
     osd->clog.error() << mode << " " << info.pgid
                      << " expected clone " << next_clone;
     ++scrubber.shallow_errors;