]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PG: chunky_scrub: degeneralize end boundary condition to head
authorSage Weil <sage@redhat.com>
Fri, 1 Sep 2017 15:43:49 +0000 (11:43 -0400)
committerSage Weil <sage@redhat.com>
Mon, 11 Sep 2017 14:13:35 +0000 (09:13 -0500)
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 <sage@redhat.com>
src/osd/PG.cc
src/osd/PG.h

index e9bbba46cd23dbfe92edf2753811e9c0a70c83fa..0ff967784fe975dfe5737d937ca82e108069999c 100644 (file)
@@ -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 {
index 2cf90d48b194ad8d2a0dd835bfc439e2769c5b61..7609ebc75e15513aa4e61797e4743554260e1c18 100644 (file)
@@ -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