From b1d34c384d7c8998dbf5da88ce4616a2c4cecc66 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Wed, 26 Jun 2024 03:16:28 +0000 Subject: [PATCH] osd/PGLog,crimson/osd/pg: remove support for rebuild_missing_set_with_deletes_crimson Reverts 9c2d11af5. PeeringListener::rebuild_missing_set_with_deletes should only be invoked upon advancing from an OSDMap where CEPH_OSDMAP_RECOVERY_DELETES is not set to one where it is. That shouldn't be possible for a crimson cluster as CEPH_OSDMAP_RECOVERY_DELETES should be set as long as require_osd_release >= luminous, which was quite a few versions ago. OSDMonitor::create_initial() defaults to squid, or as old as quincy with config options. I'm not sure this actually worked as it uses get0() on a seastar::future<>, which won't correctly deal with the thread-local interrupt_cond created by the interruptor::async wrapper in PG::do_peering_event. Additionally, PeeringListener::rebuild_missing_set_with_deletes would have been invoked under PeeringState::on_new_interval() while processing an AdvMap event, but PG::handle_advance_map doesn't actually invoke peering_state.advance_map under seastar::async or interruptor::async. Signed-off-by: Samuel Just (cherry picked from commit 4c58cb5872596d9f19b38a51c088e0d185f712e3) --- src/crimson/osd/pg.h | 5 +-- src/osd/PGLog.cc | 82 -------------------------------------------- src/osd/PGLog.h | 7 ---- 3 files changed, 1 insertion(+), 93 deletions(-) diff --git a/src/crimson/osd/pg.h b/src/crimson/osd/pg.h index a6a287e6223..92d05e06e6d 100644 --- a/src/crimson/osd/pg.h +++ b/src/crimson/osd/pg.h @@ -399,10 +399,7 @@ public: } void rebuild_missing_set_with_deletes(PGLog &pglog) final { - pglog.rebuild_missing_set_with_deletes_crimson( - shard_services.get_store(), - coll_ref, - peering_state.get_info()).get(); + ceph_assert(0 == "Impossible for crimson"); } PerfCounters &get_peering_perf() final { diff --git a/src/osd/PGLog.cc b/src/osd/PGLog.cc index e11eda5162f..b759a42290c 100644 --- a/src/osd/PGLog.cc +++ b/src/osd/PGLog.cc @@ -1206,86 +1206,4 @@ seastar::future<> PGLog::read_log_and_missing_crimson( }); } -seastar::future<> PGLog::rebuild_missing_set_with_deletes_crimson( - crimson::os::FuturizedStore::Shard &store, - crimson::os::CollectionRef ch, - const pg_info_t &info) -{ - // save entries not generated from the current log (e.g. added due - // to repair, EIO handling, or divergent_priors). - map extra_missing; - for (const auto& p : missing.get_items()) { - if (!log.logged_object(p.first)) { - ldpp_dout(this, 20) << __func__ << " extra missing entry: " << p.first - << " " << p.second << dendl; - extra_missing[p.first] = p.second; - } - } - missing.clear(); - - // go through the log and add items that are not present or older - // versions on disk, just as if we were reading the log + metadata - // off disk originally - return seastar::do_with( - set(), - log.log.rbegin(), - [this, &store, ch, &info](auto &did, auto &it) { - return seastar::repeat([this, &store, ch, &info, &it, &did] { - if (it == log.log.rend()) { - return seastar::make_ready_future( - seastar::stop_iteration::yes); - } - auto &log_entry = *it; - it++; - if (log_entry.version <= info.last_complete) - return seastar::make_ready_future( - seastar::stop_iteration::yes); - if (log_entry.soid > info.last_backfill || - log_entry.is_error() || - did.find(log_entry.soid) != did.end()) - return seastar::make_ready_future( - seastar::stop_iteration::no); - did.insert(log_entry.soid); - return store.get_attr( - ch, - ghobject_t(log_entry.soid, ghobject_t::NO_GEN, info.pgid.shard), - OI_ATTR - ).safe_then([this, &log_entry](auto bv) { - object_info_t oi(bv); - ldpp_dout(this, 20) - << "rebuild_missing_set_with_deletes_crimson found obj " - << log_entry.soid - << " version = " << oi.version << dendl; - if (oi.version < log_entry.version) { - ldpp_dout(this, 20) - << "rebuild_missing_set_with_deletes_crimson missing obj " - << log_entry.soid - << " for version = " << log_entry.version << dendl; - missing.add( - log_entry.soid, - log_entry.version, - oi.version, - log_entry.is_delete()); - } - }, - crimson::ct_error::enoent::handle([this, &log_entry] { - ldpp_dout(this, 20) - << "rebuild_missing_set_with_deletes_crimson missing object " - << log_entry.soid << dendl; - missing.add( - log_entry.soid, - log_entry.version, - eversion_t(), - log_entry.is_delete()); - return seastar::now(); - }), - crimson::ct_error::enodata::assert_failure{"unexpected enodata"} - ).then([] { - return seastar::stop_iteration::no; - }); - }); - }).then([this] { - set_missing_may_contain_deletes(); - }); -} #endif diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h index a9281e1b5f9..497805c1811 100644 --- a/src/osd/PGLog.h +++ b/src/osd/PGLog.h @@ -943,13 +943,6 @@ public: ObjectStore::CollectionHandle& ch, const pg_info_t &info); -#ifdef WITH_SEASTAR - seastar::future<> rebuild_missing_set_with_deletes_crimson( - crimson::os::FuturizedStore::Shard &store, - crimson::os::CollectionRef ch, - const pg_info_t &info); -#endif - protected: static void split_by_object( mempool::osd_pglog::list &entries, -- 2.39.5