]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/async_cleaner: renew backref cursors when they are
authorXuehan Xu <xuxuehan@qianxin.com>
Tue, 14 Oct 2025 02:48:09 +0000 (10:48 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Mon, 9 Mar 2026 09:56:40 +0000 (17:56 +0800)
generated by backref retrieval transactions and used by reclaim
transactions

Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/async_cleaner.cc
src/crimson/os/seastore/backref/backref_tree_node.h
src/crimson/os/seastore/backref_mapping.h

index b3c460173c9448ffde6daf424adc7fb6c77cd519..927e27f41a942b327a09257f13d9814d06fe8a9a 100644 (file)
@@ -1154,7 +1154,7 @@ using do_reclaim_space_ertr = base_ertr;
 using do_reclaim_space_ret = do_reclaim_space_ertr::future<>;
 do_reclaim_space_ret do_reclaim_space(
     const std::vector<CachedExtentRef> &backref_extents,
-    const backref_mapping_list_t &pin_list,
+    backref_mapping_list_t &pin_list,
     std::size_t &reclaimed,
     std::size_t &runs,
     ExtentCallbackInterface &extent_callback,
@@ -1215,6 +1215,7 @@ do_reclaim_space_ret do_reclaim_space(
           backref_manager.get_cached_backref_entries_in_range(start_pos, end_pos);
         backref_entry_query_set_t backref_entries;
         for (auto &pin : pin_list) {
+         pin.renew_cursor(t);
           backref_entries.emplace(
             pin.get_key(),
             pin.get_val(),
index 2e331146425ddfcb47795ac8dde3676bea1c02bf..f8e0612900680a3c71f459d05ae4e8b22a4269cb 100644 (file)
@@ -187,6 +187,17 @@ struct BackrefCursor :
     assert(!is_end());
     return iter.get_val().type;
   }
+
+  BackrefCursor* renew_cursor(Transaction &t) {
+    auto c = op_context_t{ctx.cache, t};
+    t.maybe_add_to_read_set(parent);
+    return new BackrefCursor(
+      c,
+      std::move(parent),
+      modifications,
+      std::move(iter));
+  }
+
 };
 using BackrefCursorRef = boost::intrusive_ptr<BackrefCursor>;
 
index 4702ba6095fef39b1794f71e550fb8c8bd3d9af6..1d4e78e9b7e7232fa3dec7e19df696c35914bbf7 100644 (file)
@@ -54,6 +54,10 @@ public:
     assert(cursor);
     return cursor->get_type();
   }
+
+  void renew_cursor(Transaction &t) {
+    cursor.reset(cursor->renew_cursor(t));
+  }
 };
 
 using backref_mapping_list_t = std::list<BackrefMapping>;