From 5fc8b847c9b1705485b87af17d5af085a65eab04 Mon Sep 17 00:00:00 2001 From: Xuehan Xu Date: Wed, 26 Jun 2024 20:58:35 +0800 Subject: [PATCH] crimson/os/seastore/btree: interrupt transactions immediately when getting children Fixes: https://tracker.ceph.com/issues/66851 Signed-off-by: Xuehan Xu --- src/crimson/os/seastore/btree/fixed_kv_btree.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/crimson/os/seastore/btree/fixed_kv_btree.h b/src/crimson/os/seastore/btree/fixed_kv_btree.h index 5000b2e94def..6424c3025364 100644 --- a/src/crimson/os/seastore/btree/fixed_kv_btree.h +++ b/src/crimson/os/seastore/btree/fixed_kv_btree.h @@ -1491,9 +1491,9 @@ private: // checking the lba child must be atomic with creating // and linking the absent child if (v.has_child()) { - return v.get_child_fut().safe_then( - [on_found=std::move(on_found), node_iter, c, - parent_entry](auto child) mutable { + return trans_intr::make_interruptible(std::move(v.get_child_fut()) + ).si_then([on_found=std::move(on_found), node_iter, c, + parent_entry](auto child) { LOG_PREFIX(FixedKVBtree::lookup_internal_level); SUBTRACET(seastore_fixedkv_tree, "got child on {}, pos: {}, res: {}", @@ -1561,9 +1561,9 @@ private: // checking the lba child must be atomic with creating // and linking the absent child if (v.has_child()) { - return v.get_child_fut().safe_then( - [on_found=std::move(on_found), node_iter, c, - parent_entry](auto child) mutable { + return trans_intr::make_interruptible(std::move(v.get_child_fut()) + ).si_then([on_found=std::move(on_found), node_iter, c, + parent_entry](auto child) { LOG_PREFIX(FixedKVBtree::lookup_leaf); SUBTRACET(seastore_fixedkv_tree, "got child on {}, pos: {}, res: {}", @@ -2116,9 +2116,9 @@ private: // checking the lba child must be atomic with creating // and linking the absent child if (v.has_child()) { - return v.get_child_fut().safe_then( - [do_merge=std::move(do_merge), &pos, - donor_iter, donor_is_left, c, parent_pos](auto child) mutable { + return trans_intr::make_interruptible(std::move(v.get_child_fut()) + ).si_then([do_merge=std::move(do_merge), &pos, + donor_iter, donor_is_left, c, parent_pos](auto child) { LOG_PREFIX(FixedKVBtree::merge_level); SUBTRACET(seastore_fixedkv_tree, "got child on {}, pos: {}, res: {}", -- 2.47.3