From: Zhang Song Date: Wed, 30 Jul 2025 07:39:55 +0000 (+0800) Subject: crimson/os/seastore: don't add shadow extent to cache X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=69b765d0a2779613da19113041ddd6059566bb0d;p=ceph-ci.git crimson/os/seastore: don't add shadow extent to cache Signed-off-by: Zhang Song Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/os/seastore/cache.h b/src/crimson/os/seastore/cache.h index 605a5cf35d9..b85521574a8 100644 --- a/src/crimson/os/seastore/cache.h +++ b/src/crimson/os/seastore/cache.h @@ -1652,6 +1652,9 @@ private: extent_len_t load_length) { assert(ext.get_paddr().is_absolute()); + if (ext.is_shadow_extent()) { + return; + } if (hint == CACHE_HINT_NOCACHE && is_logical_type(ext.get_type())) { return; } diff --git a/src/crimson/os/seastore/cached_extent.h b/src/crimson/os/seastore/cached_extent.h index 3f70bb8df46..d2358399986 100644 --- a/src/crimson/os/seastore/cached_extent.h +++ b/src/crimson/os/seastore/cached_extent.h @@ -909,6 +909,14 @@ public: last_touch_end = touch_end; } + bool is_shadow_extent() const { + return is_shadow; + } + + void set_shadow_extent(bool b) { + is_shadow = b; + } + private: template friend class read_set_item_t; @@ -1035,6 +1043,8 @@ private: void new_committer(Transaction &t); + bool is_shadow = false; + protected: trans_view_set_t mutation_pending_extents; trans_view_set_t retired_transactions; diff --git a/src/crimson/os/seastore/logical_child_node.h b/src/crimson/os/seastore/logical_child_node.h index 43721747faf..ea4bb9c6a76 100644 --- a/src/crimson/os/seastore/logical_child_node.h +++ b/src/crimson/os/seastore/logical_child_node.h @@ -28,7 +28,7 @@ public: } virtual ~LogicalChildNode() { - if (this->is_stable()) { + if (this->is_stable() && !is_shadow_extent()) { lba_child_node_t::destroy(); } } diff --git a/src/crimson/os/seastore/transaction_manager.cc b/src/crimson/os/seastore/transaction_manager.cc index 0a9a4b2921d..8fc6d2f425a 100644 --- a/src/crimson/os/seastore/transaction_manager.cc +++ b/src/crimson/os/seastore/transaction_manager.cc @@ -1168,7 +1168,7 @@ TransactionManager::promote_extent( 0, orig_ext->get_length(), std::nullopt); - boost::ignore_unused(remapped_cold_extent); + remapped_cold_extent->set_shadow_extent(true); remapped_cold_extent->set_shadow_extent(true); } diff --git a/src/crimson/os/seastore/transaction_manager.h b/src/crimson/os/seastore/transaction_manager.h index 7006933ff9e..7919f09689a 100644 --- a/src/crimson/os/seastore/transaction_manager.h +++ b/src/crimson/os/seastore/transaction_manager.h @@ -1545,7 +1545,7 @@ private: remap_offset, remap_len, std::nullopt); - boost::ignore_unused(cold_ext); + cold_ext->set_shadow_extent(true); } // user must initialize the logical extent themselves. remapped_extent->set_seen_by_users();