]> 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>
Sat, 23 May 2026 09:11:36 +0000 (17:11 +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 605a5cf35d999f56ba27cae96cf2a9a882882b0a..b85521574a8783f70024716f71d222c9a80b8fcb 100644 (file)
@@ -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;
     }
index 3f70bb8df464914216593a47fe27dc8daed1200f..d2358399986e0cecd5a5bd409a2d6715741727cb 100644 (file)
@@ -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 <typename T>
   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;
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 0a9a4b2921dafa70d5092181243a475eec342f19..8fc6d2f425aaf12152b0a07958caaf0483f1b06a 100644 (file)
@@ -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);
   }
index 7006933ff9e10aa578adf034f6a9ea67799a7f02..7919f09689a503bef17b8935be9ca10b40334a0b 100644 (file)
@@ -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();