From: Xuehan Xu Date: Mon, 20 Jul 2026 02:18:12 +0000 (+0800) Subject: crimson/os/seastore/transaction_manager: allow non-existing lba regions X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6b6c8d4da3d42a2580aa2fab49a5be05c96e77d7;p=ceph.git crimson/os/seastore/transaction_manager: allow non-existing lba regions 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 --- diff --git a/src/crimson/os/seastore/transaction_manager.cc b/src/crimson/os/seastore/transaction_manager.cc index f0fd2a5d222c..025a23c79004 100644 --- a/src/crimson/os/seastore/transaction_manager.cc +++ b/src/crimson/os/seastore/transaction_manager.cc @@ -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(); + }), 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 extents; while ((ret.demoted_size + ret.evicted_size) < max_proceed_size) { if (it.is_end() || it.get_key().get_object_prefix() != prefix) {