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=bedf49ddbaa04337e26cf63305182baacf1062bd;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 4baea5a1528..f7b881da33a 100644 --- a/src/crimson/os/seastore/cache.h +++ b/src/crimson/os/seastore/cache.h @@ -1705,6 +1705,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 39e77d8eec9..e7ffc15bac2 100644 --- a/src/crimson/os/seastore/cached_extent.h +++ b/src/crimson/os/seastore/cached_extent.h @@ -910,6 +910,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; @@ -1036,6 +1044,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 648cfb90250..2dc0f9dedf5 100644 --- a/src/crimson/os/seastore/transaction_manager.cc +++ b/src/crimson/os/seastore/transaction_manager.cc @@ -1224,7 +1224,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 71a9bcf8e4d..7bca4af4224 100644 --- a/src/crimson/os/seastore/transaction_manager.h +++ b/src/crimson/os/seastore/transaction_manager.h @@ -1544,7 +1544,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();