From: Sage Weil Date: Thu, 27 Mar 2014 22:12:25 +0000 (-0700) Subject: osd/ReplicatedPG: tolerate missing clones in cache pools X-Git-Tag: v0.79~72^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1547%2Fhead;p=ceph.git osd/ReplicatedPG: tolerate missing clones in cache pools 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 --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 53c877a29299..0d0db5f572a6 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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;