]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.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>
Thu, 30 Jul 2026 02:12:26 +0000 (10:12 +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 873bc7294f9733a9101caa1e674eff6b7fd1fc75..1b195dffb0f0215b40131317f11231eac1d767ae 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 cfb07b509d535b05e9d40ee8f84a4af5f3726510..3d69ea73f32cc2079682cfb7e9ef0d4873bfb076 100644 (file)
@@ -908,6 +908,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:
 
   seastar::shared_mutex commit_lock;
 
+  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 cf99f120272117313cd34b0c9cedcd7fa32b4c88..9657a79c84b2d9c42d757febaa43aa4d84014e34 100644 (file)
@@ -1276,7 +1276,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 985cf5321ed490fc3cfe773dca7f7a5186b21787..07c1a11f455d71fc7bb9ee93b49913d3ab1230ef 100644 (file)
@@ -1590,7 +1590,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();