]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/hobject: introduce get_max_object_boundary
authorSamuel Just <sjust@redhat.com>
Mon, 23 Oct 2023 23:45:58 +0000 (16:45 -0700)
committerSamuel Just <sjust@redhat.com>
Mon, 11 Dec 2023 04:10:17 +0000 (04:10 +0000)
Scrub doesn't want to split snapshot sets across chunks.  The range,
however, is exclusive on the right.  get_max_object_boundary() gives
us a way to always include head and all snapshots in the same chunk
as it will sort greater than any legal object with the same head.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/common/hobject.h

index 34191ccf5ec88b86a661f12073642cdb5190d613..e35e2b0732f6b9ea8ece8d243c82b1ea7aabec71 100644 (file)
@@ -166,6 +166,7 @@ public:
     return ret;
   }
 
+  /// @return min hobject_t ret s.t. ret.get_head() == get_head()
   hobject_t get_object_boundary() const {
     if (is_max())
       return *this;
@@ -174,6 +175,15 @@ public:
     return ret;
   }
 
+  /// @return max hobject_t ret s.t. ret.get_head() == get_head()
+  hobject_t get_max_object_boundary() const {
+    if (is_max())
+      return *this;
+    // CEPH_SNAPDIR happens to sort above HEAD and MAX_SNAP and is no longer used
+    // for actual objects
+    return get_snapdir();
+  }
+
   /// @return head version of this hobject_t
   hobject_t get_head() const {
     hobject_t ret(*this);