]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/SnapMapper: add common logs 55645/head
authorMatan Breizman <mbreizma@redhat.com>
Mon, 12 Feb 2024 09:31:52 +0000 (09:31 +0000)
committerRonen Friedman <rfriedma@redhat.com>
Mon, 18 Mar 2024 20:09:21 +0000 (15:09 -0500)
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
(cherry picked from commit f302be018ebef365d8876d14185c4bdb246f22d8)

src/osd/SnapMapper.cc

index e6a2b4d7d5575db0c85bf28219adc83e35f0f5f0..2a7ee5e51cc42110fa209ae9d95e0e558bf0a77b 100644 (file)
@@ -591,18 +591,22 @@ vector<hobject_t> SnapMapper::get_objects_by_prefixes(
       // access RocksDB (an expensive operation!)
       int r = backend.get_next(pos, &next);
       dout(20) << __func__ << " get_next(" << pos << ") returns " << r
-              << " " << next << dendl;
+              << " " << next.first << dendl;
       if (r != 0) {
        return out; // Done
       }
 
-      if (!next.first.starts_with(prefix)) {
+      ceph_assert(is_mapping(next.first));
+
+      if (auto next_prefix = next.first.substr(0, prefix.size());
+          next_prefix != prefix) {
        // TBD: we access the DB twice for the first object of each iterator...
+       dout(20) << fmt::format("{}: breaking, prefix expected {} got {}",
+                               __func__, prefix, next_prefix)
+                << dendl;
        break; // Done with this prefix
       }
 
-      ceph_assert(is_mapping(next.first));
-
       dout(20) << __func__ << " " << next.first << dendl;
       pair<snapid_t, hobject_t> next_decoded(from_raw(next));
       ceph_assert(next_decoded.first == snap);
@@ -613,6 +617,9 @@ vector<hobject_t> SnapMapper::get_objects_by_prefixes(
     }
 
     if (out.size() >= max) {
+      dout(20) << fmt::format("{}: reached max of: {} returning",
+                              __func__, out.size())
+               << dendl;
       return out;
     }
   }