]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore: don't add shadow extent to cache
authorZhang Song <zhangsong02@qianxin.com>
Wed, 30 Jul 2025 07:39:55 +0000 (15:39 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Tue, 7 Jul 2026 08:15:30 +0000 (16:15 +0800)
Signed-off-by: Zhang Song <zhangsong02@qianxin.com>
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/cache.h
src/crimson/os/seastore/cached_extent.h
src/crimson/os/seastore/logical_child_node.h
src/crimson/os/seastore/transaction_manager.cc
src/crimson/os/seastore/transaction_manager.h

index 4baea5a1528fdfc3979eeed2a06d2478da963ee4..f7b881da33a5d1cafff78dc87f8b68aefb84af57 100644 (file)
@@ -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;
     }
index 39e77d8eec91da36799aba6c5bfc1f412b8c8427..e7ffc15bac22ea33205d1507efc42f39a41baede 100644 (file)
@@ -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 <typename T>
   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;
index 43721747faf9e6e3e17a44f646bf542555478c3a..ea4bb9c6a763be72b1357cd52ff0dbd2a8eda3f3 100644 (file)
@@ -28,7 +28,7 @@ public:
   }
 
   virtual ~LogicalChildNode() {
-    if (this->is_stable()) {
+    if (this->is_stable() && !is_shadow_extent()) {
       lba_child_node_t::destroy();
     }
   }
index 648cfb902500d4317c510fc2498f6ee2d7886a49..2dc0f9dedf51d4ea8d33adb516fa89dd0b777b24 100644 (file)
@@ -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);
   }
index 71a9bcf8e4debbf5b4075db66444c237891a39d3..7bca4af42243347b2bf64eecbe85ca33f8ee219a 100644 (file)
@@ -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();