From: Xuehan Xu Date: Thu, 21 May 2026 07:10:59 +0000 (+0800) Subject: crimson/os/seastore: drop RetiredExtentPlaceholder X-Git-Tag: v21.0.1~164^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4ade51483a34e097caf1dd9581fee1abcab4191d;p=ceph.git crimson/os/seastore: drop RetiredExtentPlaceholder Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/os/seastore/backref_entry.h b/src/crimson/os/seastore/backref_entry.h index 000be853d2b..a1cf53269df 100644 --- a/src/crimson/os/seastore/backref_entry.h +++ b/src/crimson/os/seastore/backref_entry.h @@ -97,8 +97,7 @@ struct backref_entry_t { const paddr_t& paddr, extent_len_t len, extent_types_t type) { - assert(is_backref_mapped_type(type) || - is_retired_placeholder_type(type)); + assert(is_backref_mapped_type(type)); return std::make_unique( paddr, L_ADDR_NULL, len, type); } diff --git a/src/crimson/os/seastore/cache.cc b/src/crimson/os/seastore/cache.cc index 8272db88fde..b991e0c1295 100644 --- a/src/crimson/os/seastore/cache.cc +++ b/src/crimson/os/seastore/cache.cc @@ -144,7 +144,6 @@ void Cache::register_metrics(store_index_t store_index) {extent_types_t::ONODE_BLOCK_STAGED, {sm::label_instance("ext", "ONODE_BLOCK_STAGED")}}, {extent_types_t::COLL_BLOCK, {sm::label_instance("ext", "COLL_BLOCK")}}, {extent_types_t::OBJECT_DATA_BLOCK, {sm::label_instance("ext", "OBJECT_DATA_BLOCK")}}, - {extent_types_t::RETIRED_PLACEHOLDER, {sm::label_instance("ext", "RETIRED_PLACEHOLDER")}}, {extent_types_t::ALLOC_INFO, {sm::label_instance("ext", "ALLOC_INFO")}}, {extent_types_t::JOURNAL_TAIL, {sm::label_instance("ext", "JOURNAL_TAIL")}}, {extent_types_t::TEST_BLOCK, {sm::label_instance("ext", "TEST_BLOCK")}}, @@ -493,7 +492,7 @@ void Cache::register_metrics(store_index_t store_index) } /** - * Cached extents (including placeholders) + * Cached extents * * Dirty extents */ @@ -896,7 +895,7 @@ void Cache::remove_extent( ref->get_paddr().is_root()); if (ref->is_stable_dirty()) { remove_from_dirty(ref, p_src); - } else if (!ref->is_placeholder()) { + } else { assert(ref->get_paddr().is_absolute()); pinboard->remove(*ref); } @@ -1193,9 +1192,6 @@ CachedExtentRef Cache::alloc_new_non_data_extent_by_type( case extent_types_t::COLL_BLOCK: return alloc_new_non_data_extent( t, length, hint, gen); - case extent_types_t::RETIRED_PLACEHOLDER: - ceph_assert(0 == "impossible"); - return CachedExtentRef(); case extent_types_t::TEST_BLOCK_PHYSICAL: return alloc_new_non_data_extent(t, length, hint, gen); case extent_types_t::LOG_NODE: @@ -1322,7 +1318,6 @@ record_t Cache::prepare_record( auto trans_src = t.get_src(); assert(!t.is_weak()); assert(trans_src != Transaction::src_t::READ); - assert(t.read_set.size() + t.num_replace_placeholder == t.read_items.size()); auto& efforts = get_by_src(stats.committed_efforts_by_src, trans_src); @@ -1519,8 +1514,7 @@ record_t Cache::prepare_record( } // Note: commit extents and backref allocations in the same place - if (is_backref_mapped_type(extent->get_type()) || - is_retired_placeholder_type(extent->get_type())) { + if (is_backref_mapped_type(extent->get_type())) { DEBUGT("backref_entry free {}~0x{:x}", t, extent->get_paddr(), @@ -2319,9 +2313,6 @@ Cache::replay_delta( // replay is not included by the cache hit metrics auto ret = query_cache(addr); if (ret) { - // no retired-placeholder should be exist yet because no transaction - // has been created. - assert(!is_retired_placeholder_type(ret->get_type())); return ret->wait_io().then([ret] { return ret; }); @@ -2562,9 +2553,6 @@ Cache::_get_absent_extent_by_type( case extent_types_t::OBJECT_DATA_BLOCK: ret = CachedExtent::make_cached_extent_ref(length); break; - case extent_types_t::RETIRED_PLACEHOLDER: - ceph_assert(0 == "impossible"); - break; case extent_types_t::TEST_BLOCK: ret = CachedExtent::make_cached_extent_ref(length); break; @@ -2682,9 +2670,6 @@ Cache::do_get_caching_extent_by_type( ).safe_then([](auto extent) { return CachedExtentRef(extent.detach(), false /* add_ref */); }); - case extent_types_t::RETIRED_PLACEHOLDER: - ceph_assert(0 == "impossible"); - return get_extent_ertr::make_ready_future(); case extent_types_t::TEST_BLOCK: return do_get_caching_extent( offset, length, std::move(extent_init_func), std::move(on_cache), p_src diff --git a/src/crimson/os/seastore/cache.h b/src/crimson/os/seastore/cache.h index 207888494c7..9d289c1672c 100644 --- a/src/crimson/os/seastore/cache.h +++ b/src/crimson/os/seastore/cache.h @@ -103,8 +103,7 @@ class SegmentProvider; * - TRACE: DEBUG details * - seastore_t logs */ -class Cache : public ExtentTransViewRetriever, - public RetiredExtentPlaceholderInvalidater { +class Cache : public ExtentTransViewRetriever { public: Cache(ExtentPlacementManager &epm, store_index_t store_index); ~Cache(); @@ -268,14 +267,6 @@ public: return get_extent_if_cached_iertr::make_ready_future(); } - if (is_retired_placeholder_type(ret->get_type())) { - // retired_placeholder is not really cached yet - SUBDEBUGT(seastore_cache, - "{} {}~0x{:x} ~0x{:x} is absent(placeholder) in cache", - t, type, paddr, len, ret->get_length()); - return get_extent_if_cached_iertr::make_ready_future(); - } - if (ret->get_length() != len) { SUBDEBUGT(seastore_cache, "{} {}~0x{:x} is present in cache with inconsistent length 0x{:x} -- {}", @@ -305,7 +296,7 @@ public: ret->cast(), 0, ret->get_length(), &t_src)); } - // present in cache(fully loaded) and is not a retired_placeholder + // present in cache(fully loaded) SUBDEBUGT(seastore_cache, "{} {}~0x{:x} is present in cache -- {}", t, type, paddr, len, *ret); @@ -374,18 +365,6 @@ public: } } - void invalidate_retired_placeholder( - Transaction &t, - CachedExtent &retired_placeholder, - CachedExtent &extent) { - // replace placeholder in transactions - while (!retired_placeholder.read_transactions.empty()) { - auto t = retired_placeholder.read_transactions.begin()->t; - t->replace_placeholder(retired_placeholder, extent); - } - retired_placeholder.set_invalid(t); - } - /* * prepare_absent_extent * @@ -536,7 +515,6 @@ public: assert(extent.is_fully_loaded()); const auto t_src = t.get_src(); auto ext_type = extent.get_type(); - assert(!is_retired_placeholder_type(ext_type)); cache_access_stats_t& access_stats = get_by_ext( get_by_src(stats.access_by_src_ext, t_src), ext_type); @@ -604,12 +582,6 @@ public: const auto t_src = t.get_src(); auto ext_type = extent->get_type(); - // FIXME: retired-placeholder isn't linked in the lba tree yet. - // We think it's still working because: - // 1. A retired-placeholder must be an ObjectDataBlock - // 2. Per rados object, no read is possible during write, - // and write cannot be parallel - assert(!is_retired_placeholder_type(ext_type)); cache_access_stats_t& access_stats = get_by_ext( get_by_src(stats.access_by_src_ext, t_src), ext_type); @@ -680,8 +652,6 @@ public: } } - // user should not see RETIRED_PLACEHOLDER extents - ceph_assert(!is_retired_placeholder_type(p_extent->get_type())); // for logical extents, handle partial load in TM::read_pin(), // also see read_extent_maybe_partial() and get_absent_extent() assert(is_logical_type(p_extent->get_type()) || @@ -902,32 +872,6 @@ private: } // extent PRESENT in cache - if (is_retired_placeholder_type(cached->get_type())) { - // partial read - TCachedExtentRef ret = CachedExtent::make_cached_extent_ref(length); - ret->init(CachedExtent::extent_state_t::CLEAN, - offset, - PLACEMENT_HINT_NULL, - NULL_GENERATION, - TRANS_ID_NULL); - SUBDEBUG(seastore_cache, - "{} {}~0x{:x} is absent(placeholder), add extent and reading range 0x{:x}~0x{:x} ... -- {}", - T::TYPE, offset, length, partial_off, partial_len, *ret); - extent_init_func(*ret); - on_cache(*ret); - extents_index.replace(*ret, *cached); - - // replace placeholder in transactions - while (!cached->read_transactions.empty()) { - auto t = cached->read_transactions.begin()->t; - t->replace_placeholder(*cached, *ret); - } - - cached->state = CachedExtent::extent_state_t::INVALID; - return read_extent( - std::move(ret), partial_off, partial_len, p_src); - } - auto ret = TCachedExtentRef(static_cast(cached.get())); on_cache(*ret); if (ret->is_range_loaded(partial_off, partial_len)) { @@ -1743,7 +1687,7 @@ private: if (hint == CACHE_HINT_NOCACHE && is_logical_type(ext.get_type())) { return; } - if (ext.is_stable_clean() && !ext.is_placeholder()) { + if (ext.is_stable_clean()) { pinboard->move_to_top(ext, p_src, load_start, load_length); } } @@ -1956,7 +1900,6 @@ private: /// Add extent to extents handling dirty and refcounting /// /// Note, it must follows with add_to_dirty() or touch_extent(). - /// The only exception is RetiredExtentPlaceholder. void add_extent(CachedExtentRef ref); /// Mark exising extent ref dirty -- mainly for replay @@ -2243,7 +2186,6 @@ void stage_visibility_handoff(Transaction& t, } } - // Extents in cache may contain placeholders CachedExtentRef query_cache(paddr_t offset) { if (auto iter = extents_index.find_offset(offset); iter != extents_index.end()) { diff --git a/src/crimson/os/seastore/cached_extent.h b/src/crimson/os/seastore/cached_extent.h index 4c10d1a9e6a..043edd61817 100644 --- a/src/crimson/os/seastore/cached_extent.h +++ b/src/crimson/os/seastore/cached_extent.h @@ -689,11 +689,6 @@ public: return !is_valid() || (prior_instance && !prior_instance->is_valid()); } - /// Returns true if extent is a placeholder - bool is_placeholder() const { - return is_retired_placeholder_type(get_type()); - } - bool is_pending_io() const { return io_wait.has_value(); } @@ -1096,17 +1091,6 @@ protected: // must call init() to fully initialize } - struct retired_placeholder_construct_t {}; - CachedExtent(retired_placeholder_construct_t, extent_len_t _length) - : state(extent_state_t::CLEAN), - length(_length), - loaded_length(0), - buffer_space(std::in_place) { - assert(!is_fully_loaded()); - assert(is_aligned(length, CEPH_PAGE_SIZE)); - // must call init() to fully initialize - } - friend class Cache; friend class ExtentQueue; friend class ExtentPinboardLRU; diff --git a/src/crimson/os/seastore/extent_pinboard.cc b/src/crimson/os/seastore/extent_pinboard.cc index 02fe9fb93d0..418afd928ba 100644 --- a/src/crimson/os/seastore/extent_pinboard.cc +++ b/src/crimson/os/seastore/extent_pinboard.cc @@ -40,7 +40,6 @@ class ExtentQueue { CachedExtent &extent, const Transaction::src_t* p_src) { assert(extent.is_stable_clean()); - assert(!extent.is_placeholder()); assert(extent.is_linked_to_list()); assert(list.size() > 0); auto extent_loaded_length = extent.get_loaded_length(); @@ -100,7 +99,6 @@ public: CachedExtent &extent, const Transaction::src_t* p_src) { assert(extent.is_stable_clean()); - assert(!extent.is_placeholder()); assert(!extent.is_linked_to_list()); // absent, add to top (back) @@ -126,7 +124,6 @@ public: CachedExtent &extent, const Transaction::src_t* p_src) { assert(extent.is_stable_clean()); - assert(!extent.is_placeholder()); assert(extent.is_linked_to_list()); // present, move to top (back) @@ -143,7 +140,6 @@ public: assert(extent.is_data_stable()); assert(extent.is_linked_to_list()); assert(extent.is_stable_clean()); - assert(!extent.is_placeholder()); // present, increase size assert(list.size() > 0); diff --git a/src/crimson/os/seastore/linked_tree_node.h b/src/crimson/os/seastore/linked_tree_node.h index bf67a24bf52..bd077130f6c 100644 --- a/src/crimson/os/seastore/linked_tree_node.h +++ b/src/crimson/os/seastore/linked_tree_node.h @@ -9,27 +9,11 @@ namespace crimson::os::seastore { -struct RetiredExtentPlaceholderInvalidater { - virtual void invalidate_retired_placeholder( - Transaction &t, - CachedExtent &retired_placeholder, - CachedExtent &extent) = 0; -}; - template class child_pos_t { public: child_pos_t(TCachedExtentRef stable_parent, btreenode_pos_t pos) : stable_parent(stable_parent), pos(pos) {} - child_pos_t( - TCachedExtentRef stable_parent, - btreenode_pos_t pos, - CachedExtent* placeholder) - : stable_parent(stable_parent), - pos(pos), - retired_placeholder(placeholder) { - assert(retired_placeholder->is_placeholder()); - } TCachedExtentRef get_parent() { ceph_assert(stable_parent); @@ -42,18 +26,9 @@ public: void link_child(ChildT *c) { get_parent()->link_child(c, pos); } - void invalidate_retired_placeholder( - Transaction &t, - RetiredExtentPlaceholderInvalidater &repi, - CachedExtent &extent) { - if (retired_placeholder) { - repi.invalidate_retired_placeholder(t, *retired_placeholder, extent); - } - } private: TCachedExtentRef stable_parent; btreenode_pos_t pos = std::numeric_limits::max(); - CachedExtentRef retired_placeholder; }; using get_child_iertr = trans_iertrget_parent(); } virtual key_t node_begin() const = 0; - virtual bool is_retired_placeholder() const = 0; virtual bool _is_pending_io() const = 0; virtual bool _is_mutable() const = 0; virtual bool _is_exist_clean() const = 0; @@ -365,26 +339,15 @@ public: auto child = children[pos]; ceph_assert(!is_reserved_ptr(child)); if (is_valid_child_ptr(child)) { - if (child->is_retired_placeholder()) { - assert(me.is_stable()); - return child_pos_t( - &me, pos, dynamic_cast(child)); - } else { - return etvr.get_extent_viewable_by_trans( - t, static_cast(child)); - } + return etvr.get_extent_viewable_by_trans( + t, static_cast(child)); } else if (me.is_pending()) { auto &sparent = me.get_stable_for_key(key); auto spos = sparent.lower_bound(key).get_offset(); auto child = sparent.children[spos]; if (is_valid_child_ptr(child)) { - if (child->is_retired_placeholder()) { - return child_pos_t( - &sparent, spos, dynamic_cast(child)); - } else { - return etvr.get_extent_viewable_by_trans( - t, static_cast(child)); - } + return etvr.get_extent_viewable_by_trans( + t, static_cast(child)); } else { return child_pos_t(&sparent, spos); } @@ -402,7 +365,6 @@ public: assert(child->_is_stable()); if (unlikely(children[pos] != nullptr)) { assert(is_valid_child_ptr(children[pos])); - assert(children[pos]->is_retired_placeholder()); } ceph_assert(is_valid_child_ptr(child)); update_child_ptr(pos, child); @@ -1107,10 +1069,6 @@ public: } } - bool is_retired_placeholder() const final { - auto &me = down_cast(); - return me.is_placeholder(); - } protected: void on_invalidated() { this->reset_parent_tracker(); diff --git a/src/crimson/os/seastore/logical_child_node.h b/src/crimson/os/seastore/logical_child_node.h index e143e323755..43721747faf 100644 --- a/src/crimson/os/seastore/logical_child_node.h +++ b/src/crimson/os/seastore/logical_child_node.h @@ -10,89 +10,6 @@ namespace crimson::os::seastore { -/** - * RetiredExtentPlaceholder - * - * Cache::retire_extent_addr(Transaction&, paddr_t, extent_len_t) can retire an - * extent not currently in cache. In that case, in order to detect transaction - * invalidation, we need to add a placeholder to the cache to create the - * mapping back to the transaction. And whenever there is a transaction tries - * to read the placeholder extent out, Cache is responsible to replace the - * placeholder by the real one. Anyway, No placeholder extents should escape - * the Cache interface boundary. - */ -class RetiredExtentPlaceholder - : public CachedExtent, - public ChildNode { - - using lba_child_node_t = - ChildNode; -public: - RetiredExtentPlaceholder(extent_len_t length) - : CachedExtent(CachedExtent::retired_placeholder_construct_t{}, length) {} - - ~RetiredExtentPlaceholder() { - if (this->is_stable()) { - lba_child_node_t::destroy(); - } - } - - void on_invalidated(Transaction&) final { - this->lba_child_node_t::on_invalidated(); - } - - CachedExtentRef duplicate_for_write(Transaction&) final { - ceph_abort_msg("Should never happen for a placeholder"); - return CachedExtentRef(); - } - - ceph::bufferlist get_delta() final { - ceph_abort_msg("Should never happen for a placeholder"); - return ceph::bufferlist(); - } - - static constexpr extent_types_t TYPE = extent_types_t::RETIRED_PLACEHOLDER; - extent_types_t get_type() const final { - return TYPE; - } - - void apply_delta_and_adjust_crc( - paddr_t base, const ceph::bufferlist &bl) final { - ceph_abort_msg("Should never happen for a placeholder"); - } - - void on_rewrite(Transaction &, CachedExtent&, extent_len_t) final {} - - std::ostream &print_detail(std::ostream &out) const final { - return out << ", RetiredExtentPlaceholder"; - } - - void on_delta_write(paddr_t record_block_offset) final { - ceph_abort_msg("Should never happen for a placeholder"); - } - - void set_laddr(laddr_t laddr) { - this->laddr = laddr; - } - - bool is_btree_root() const { - return false; - } - - laddr_t get_begin() const { - assert(laddr != L_ADDR_NULL); - return laddr; - } - - laddr_t get_end() const { - assert(laddr != L_ADDR_NULL); - return (laddr + get_length()).checked_to_laddr(); - } - -private: - laddr_t laddr = L_ADDR_NULL; -}; - class LogicalChildNode : public LogicalCachedExtent, public ChildNode(extent_types_t::NONE); @@ -1512,10 +1511,6 @@ constexpr bool is_logical_type(extent_types_t type) { } } -constexpr bool is_retired_placeholder_type(extent_types_t type) { - return type == extent_types_t::RETIRED_PLACEHOLDER; -} - constexpr bool is_root_type(extent_types_t type) { return type == extent_types_t::ROOT; } @@ -2109,8 +2104,7 @@ struct alloc_blk_t { extent_len_t len, extent_types_t type) { assert(is_backref_mapped_type(type) || - is_backref_node(type) || - is_retired_placeholder_type(type)); + is_backref_node(type)); return alloc_blk_t(paddr, L_ADDR_NULL, len, type); } }; @@ -3055,7 +3049,7 @@ std::ostream& operator<<(std::ostream&, const dirty_io_stats_printer_t&); * Doesn't account: * replay * rewrite - * retiring/placeholder + * retiring * get_caching_extent() -- test only * get_caching_extent_by_type() -- test only */ diff --git a/src/crimson/os/seastore/transaction.h b/src/crimson/os/seastore/transaction.h index cede735aae0..2b56aef47fe 100644 --- a/src/crimson/os/seastore/transaction.h +++ b/src/crimson/os/seastore/transaction.h @@ -127,10 +127,6 @@ public: get_extent_ret get_extent(paddr_t addr, CachedExtentRef *out) { assert(addr.is_real_location() || addr.is_root()); auto [result, ext] = do_get_extent(addr); - // placeholder in read-set must be in the retired-set - // at the same time, user should not see a placeholder. - assert(result != get_extent_ret::PRESENT || - !is_retired_placeholder_type(ext->get_type())); if (out && result == get_extent_ret::PRESENT) { *out = ext; } @@ -316,48 +312,6 @@ public: } } - void replace_placeholder(CachedExtent& placeholder, CachedExtent& extent) { - LOG_PREFIX(Transaction::replace_placeholder); - ceph_assert(!is_weak()); - - assert(is_retired_placeholder_type(placeholder.get_type())); - assert(!is_retired_placeholder_type(extent.get_type())); - assert(!is_root_type(extent.get_type())); - assert(extent.get_paddr() == placeholder.get_paddr()); - assert(extent.get_paddr().is_absolute()); - { - auto where = read_set.find(placeholder.get_paddr(), extent_cmp_t{}); - if (unlikely(where == read_set.end())) { - SUBERRORT(seastore_t, - "unable to find placeholder {}", *this, placeholder); - ceph_abort(); - } - if (unlikely(where->ref.get() != &placeholder)) { - SUBERRORT(seastore_t, - "inconsistent placeholder, current: {}; should-be: {}", - *this, *where->ref.get(), placeholder); - ceph_abort(); - } - placeholder.read_transactions.erase( - read_trans_set_t::s_iterator_to(*where)); - where = read_set.erase(where); - // Note, the retired-placeholder is not removed from read_items after replace. - read_items.emplace_back(this, &extent); - auto it = read_set.insert_before(where, read_items.back()); - extent.read_transactions.insert(const_cast&>(*it)); -#ifndef NDEBUG - num_replace_placeholder++; -#endif - } - { - auto where = retired_set.find(&placeholder); - assert(where != retired_set.end()); - assert(where->extent.get() == &placeholder); - where = retired_set.erase(where); - retired_set.emplace_hint(where, &extent, trans_id); - } - } - auto get_delayed_alloc_list() { std::list ret; for (auto& extent : delayed_alloc_list) { @@ -701,9 +655,6 @@ private: void clear_read_set() { read_items.clear(); assert(read_set.empty()); -#ifndef NDEBUG - num_replace_placeholder = 0; -#endif // Automatically unlink this transaction from CachedExtent::read_transactions } @@ -839,9 +790,6 @@ private: */ read_extent_set_t read_set; ///< set of extents read by paddr std::list> read_items; -#ifndef NDEBUG - size_t num_replace_placeholder = 0; -#endif uint64_t fresh_backref_extents = 0; // counter of new backref extents diff --git a/src/crimson/os/seastore/transaction_manager.cc b/src/crimson/os/seastore/transaction_manager.cc index 720719139fa..9d65239e861 100644 --- a/src/crimson/os/seastore/transaction_manager.cc +++ b/src/crimson/os/seastore/transaction_manager.cc @@ -304,13 +304,12 @@ TransactionManager::_remove( mapping.get_val(), mapping.get_intermediate_length(), mapping.get_extent_type(), - [this, &child_pos, laddr, &t](auto &extent) mutable { + [&child_pos, laddr](auto &extent) mutable { auto lextent = extent.template cast(); assert(extent.is_logical()); assert(!lextent->has_laddr()); assert(!extent.has_been_invalidated()); child_pos.link_child(lextent.get()); - child_pos.invalidate_retired_placeholder(t, *cache, extent); lextent->set_laddr(laddr); } ); diff --git a/src/crimson/os/seastore/transaction_manager.h b/src/crimson/os/seastore/transaction_manager.h index 69fcee33df3..3bf6abf8db5 100644 --- a/src/crimson/os/seastore/transaction_manager.h +++ b/src/crimson/os/seastore/transaction_manager.h @@ -372,14 +372,12 @@ public: pin.partial_len, [laddr=pin.mapping.get_intermediate_base(), maybe_init=std::move(maybe_init), - child_pos=std::move(ret.get_child_pos()), - &t, this] + child_pos=std::move(ret.get_child_pos())] (T &extent) mutable { assert(extent.is_logical()); assert(!extent.has_laddr()); assert(!extent.has_been_invalidated()); child_pos.link_child(&extent); - child_pos.invalidate_retired_placeholder(t, *cache, extent); extent.set_laddr(laddr); maybe_init(extent); extent.set_seen_by_users(); @@ -1414,13 +1412,12 @@ private: auto laddr = pin.get_key(); std::ignore = cache->retire_absent_extent_addr_by_type( t, laddr, original_paddr, original_len, pin.get_extent_type(), - [this, &child_pos, laddr, &t](auto &extent) mutable { + [&child_pos, laddr](auto &extent) mutable { auto lextent = extent.template cast(); assert(extent.is_logical()); assert(!lextent->has_laddr()); assert(!extent.has_been_invalidated()); child_pos.link_child(lextent.get()); - child_pos.invalidate_retired_placeholder(t, *cache, extent); lextent->set_laddr(laddr); } ); @@ -1587,13 +1584,11 @@ private: seastar::coroutine::lambda( [laddr=pin.get_intermediate_base(), maybe_init=std::move(maybe_init), - child_pos=std::move(child_pos), - &t, this] (T &extent) mutable { + child_pos=std::move(child_pos)] (T &extent) mutable { assert(extent.is_logical()); assert(!extent.has_laddr()); assert(!extent.has_been_invalidated()); child_pos.link_child(&extent); - child_pos.invalidate_retired_placeholder(t, *cache, extent); extent.set_laddr(laddr); maybe_init(extent); extent.set_seen_by_users(); @@ -1636,14 +1631,13 @@ private: direct_length, // extent_init_func seastar::coroutine::lambda( - [direct_key, child_pos=std::move(child_pos), - &t, this](CachedExtent &extent) mutable { + [direct_key, child_pos=std::move(child_pos)] + (CachedExtent &extent) mutable { assert(extent.is_logical()); auto &lextent = static_cast(extent); assert(!lextent.has_laddr()); assert(!lextent.has_been_invalidated()); child_pos.link_child(&lextent); - child_pos.invalidate_retired_placeholder(t, *cache, lextent); lextent.set_laddr(direct_key); // No change to extent::seen_by_user because this path is only // for background cleaning. diff --git a/src/test/crimson/seastore/test_btree_lba_manager.cc b/src/test/crimson/seastore/test_btree_lba_manager.cc index af05e02b7c7..5ba9bde5cd3 100644 --- a/src/test/crimson/seastore/test_btree_lba_manager.cc +++ b/src/test/crimson/seastore/test_btree_lba_manager.cc @@ -619,13 +619,12 @@ struct btree_lba_manager_test : btree_test_base { paddr, length, cursor->get_extent_type(), - [&child_pos, &t, laddr=cursor->key, this](auto &extent) { + [&child_pos, laddr=cursor->key](auto &extent) { auto lextent = extent.template cast(); ASSERT_TRUE(extent.is_logical()); ASSERT_FALSE(lextent->has_laddr()); ASSERT_FALSE(extent.has_been_invalidated()); child_pos.link_child(lextent.get()); - child_pos.invalidate_retired_placeholder(t, *cache, extent); lextent->set_laddr(laddr); }); } diff --git a/src/test/crimson/seastore/test_transaction_manager.cc b/src/test/crimson/seastore/test_transaction_manager.cc index c1ca8b5d3ba..490b1df6e4c 100644 --- a/src/test/crimson/seastore/test_transaction_manager.cc +++ b/src/test/crimson/seastore/test_transaction_manager.cc @@ -1066,9 +1066,8 @@ struct transaction_manager_test_t : extent_types_t::BACKREF_LEAF, extent_types_t::LOG_NODE }; - // exclude DINK_LADDR_LEAF, RETIRED_PLACEHOLDER, - // ALLOC_INFO, JOURNAL_TAIL - assert(all_extent_types.size() == EXTENT_TYPES_MAX - 4); + // exclude DINK_LADDR_LEAF, ALLOC_INFO, JOURNAL_TAIL + assert(all_extent_types.size() == EXTENT_TYPES_MAX - 3); std::vector all_generations; for (auto i = INIT_GENERATION; i <= epm->dynamic_max_rewrite_generation; i++) {