From: Sage Weil Date: Fri, 1 Sep 2017 15:43:49 +0000 (-0400) Subject: osd/PG: chunky_scrub: degeneralize end boundary condition to head X-Git-Tag: v13.0.1~840^2~28 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a16968927ca5348b1d4d5cdca6a201e21f211ef0;p=ceph-ci.git osd/PG: chunky_scrub: degeneralize end boundary condition to head We can swap has_snapset() for is_head(), and drop the get_head() on hobject_t's we know are head. (The original constraint on the scrub boundary is still needed; the clones get created to the left of both head and snapdir.) Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index e9bbba46cd2..0ff967784fe 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -4346,8 +4346,8 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle) /* get the start and end of our scrub chunk * * Our scrub chunk has an important restriction we're going to need to - * respect. We can't let head or snapdir be start or end. - * Using a half-open interval means that if end == head|snapdir, + * respect. We can't let head be start or end. + * Using a half-open interval means that if end == head, * we'd scrub/lock head and the clone right next to head in different * chunks which would allow us to miss clones created between * scrubbing that chunk and scrubbing the chunk including head. @@ -4373,8 +4373,8 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle) if (!objects.empty()) { hobject_t back = objects.back(); - while (candidate_end.has_snapset() && - candidate_end.get_head() == back.get_head()) { + while (candidate_end.is_head() && + candidate_end == back.get_head()) { candidate_end = back; objects.pop_back(); if (objects.empty()) { @@ -4384,8 +4384,8 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle) } back = objects.back(); } - if (candidate_end.has_snapset()) { - assert(candidate_end.get_head() != back.get_head()); + if (candidate_end.is_head()) { + assert(candidate_end != back.get_head()); candidate_end = candidate_end.get_object_boundary(); } } else { diff --git a/src/osd/PG.h b/src/osd/PG.h index 2cf90d48b19..7609ebc75e1 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1239,7 +1239,7 @@ public: int num_digest_updates_pending; // chunky scrub - hobject_t start, end; + hobject_t start, end; // [start,end) eversion_t subset_last_update; // chunky scrub state