]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd/recovery_backend: correctly handle missing object in scan_for_backfill
authorSamuel Just <sjust@redhat.com>
Tue, 15 Apr 2025 19:57:35 +0000 (12:57 -0700)
committerSamuel Just <sjust@redhat.com>
Mon, 21 Apr 2025 16:30:28 +0000 (09:30 -0700)
load_and_lock can return enoent if object is missing.

Fixes: https://tracker.ceph.com/issues/70936
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/osd/recovery_backend.cc

index dc9659972410e9443998f36ed262eacb48ef2dde..f30d34195aa25fa1ec3693de543dfff00cf5262d 100644 (file)
@@ -237,10 +237,23 @@ RecoveryBackend::scan_for_backfill(
     DEBUGDPP("querying obj:{}", pg, object);
     auto obc_manager = pg.obc_loader.get_obc_manager(
       object, /* resolve_clone = */ false);
+
+    auto found = co_await pg.obc_loader.load_and_lock(
       obc_manager, RWState::RWREAD
-    ).handle_error_interruptible(
+    ).si_then([] {
+      return true;
+    }).handle_error_interruptible(
+      crimson::ct_error::enoent::handle([](auto) {
+       return false;
+      }),
       crimson::ct_error::assert_all("unexpected error")
     );
+    if (!found) {
+      // if the object does not exist here, it must have been removed
+      // between the collection_list_partial and here.  This can happen
+      // for the first item in the range, which is usually last_backfill.
+      co_return;
+    }
 
     if (obc_manager.get_obc()->obs.exists) {
       auto version = obc_manager.get_obc()->obs.oi.version;