]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/transaction_manager: allow non-existing lba regions
authorXuehan Xu <xuxuehan@qianxin.com>
Mon, 20 Jul 2026 02:18:12 +0000 (10:18 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Fri, 31 Jul 2026 01:40:20 +0000 (09:40 +0800)
when demoting them

It is possible that, when we do demote_region, the target region has
already been removed from the lba tree, for example, a temp recovering
object might have already been renamed to the real one, which means all
lba mappings within its original region have been moved away.

Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/transaction_manager.cc

index f0fd2a5d222cf267ee1311c71a24c0372868447e..025a23c79004a5999f0b59fc1f4ed7669041f37f 100644 (file)
@@ -1579,10 +1579,21 @@ TransactionManager::demote_region(
   auto cursor = co_await lba_manager->upper_bound_right(
     t, start
   ).handle_error_interruptible(
+    crimson::ct_error::enoent::handle([](auto) {
+      // It's possible that there has been no lba mappings left
+      // when demoting a region, for example, a temp recovering
+      // object may have been renamed, which makes the lba mappings
+      // in its own region moved.
+      return seastar::make_ready_future<LBACursorRef>();
+    }),
     demote_region_iertr::pass_further{},
     crimson::ct_error::assert_all("unexpected enoent"));
-  auto it = co_await resolve_cursor_to_mapping(t, std::move(cursor));
   demote_region_res_t ret{0, 0, false};
+  if (!cursor) {
+    ret.complete = true;
+    co_return ret;
+  }
+  auto it = co_await resolve_cursor_to_mapping(t, std::move(cursor));
   std::vector<CachedExtentRef> extents;
   while ((ret.demoted_size + ret.evicted_size) < max_proceed_size) {
     if (it.is_end() || it.get_key().get_object_prefix() != prefix) {