From 99ca0448cbb984772e34c137ae44915ce4bce2ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rados=C5=82aw=20Zarzy=C5=84ski?= Date: Fri, 15 Sep 2023 15:15:01 +0200 Subject: [PATCH] osd: lay down the ECListener for ECBackend::RMWPipeline MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Radosław Zarzyński --- src/osd/ECBackend.cc | 2 +- src/osd/ECBackend.h | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index e597129626f..ec8fdc0637a 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -225,7 +225,7 @@ ECBackend::ECBackend( uint64_t stripe_width) : PGBackend(cct, pg, store, coll, ch), read_pipeline(cct, ec_impl, this->sinfo, get_parent()->get_eclistener()), - rmw_pipeline(cct, ec_impl, this->sinfo, get_parent(), *this), + rmw_pipeline(cct, ec_impl, this->sinfo, get_parent()->get_eclistener(), *this), ec_impl(ec_impl), sinfo(ec_impl->get_data_chunk_count(), stripe_width) { ceph_assert((ec_impl->get_data_chunk_count() * diff --git a/src/osd/ECBackend.h b/src/osd/ECBackend.h index 238895d3e5b..2a351113f3f 100644 --- a/src/osd/ECBackend.h +++ b/src/osd/ECBackend.h @@ -79,6 +79,20 @@ struct RecoveryMessages; std::vector>& messages, epoch_t from_epoch) = 0; virtual std::ostream& gen_dbg_prefix(std::ostream& out) const = 0; + + // RMWPipeline + virtual const pg_pool_t &get_pool() const = 0; + virtual const std::set &get_acting_recovery_backfill_shards() const = 0; + virtual bool should_send_op( + pg_shard_t peer, + const hobject_t &hoid) = 0; + virtual const std::map &get_shard_info() const = 0; + virtual spg_t primary_spg_t() const = 0; + virtual const PGLog &get_log() const = 0; + virtual DoutPrefixProvider *get_dpp() = 0; + virtual void apply_stats( + const hobject_t &soid, + const object_stat_sum_t &delta_stats) = 0; }; class ECBackend : public PGBackend { public: @@ -678,12 +692,11 @@ public: void call_write_ordered(std::function &&cb); CephContext* cct; - PGBackend::Listener *get_parent() const { return parent; } + ECListener *get_parent() const { return parent; } const OSDMapRef& get_osdmap() const { return get_parent()->pgb_get_osdmap(); } epoch_t get_osdmap_epoch() const { return get_parent()->pgb_get_osdmap_epoch(); } const pg_info_t &get_info() { return get_parent()->get_info(); } - // TODO: this will is going to be the RMWPipeline::Listener template void objects_read_async_no_cache( const std::map &to_read, @@ -715,7 +728,7 @@ public: ceph::ErasureCodeInterfaceRef ec_impl; const ECUtil::stripe_info_t& sinfo; - PGBackend::Listener* parent; + ECListener* parent; // TODO: lay an interface down here ECBackend& ec_backend; @@ -723,7 +736,7 @@ public: RMWPipeline(CephContext* cct, ceph::ErasureCodeInterfaceRef ec_impl, const ECUtil::stripe_info_t& sinfo, - PGBackend::Listener* parent, + ECListener* parent, ECBackend& ec_backend) : cct(cct), ec_impl(std::move(ec_impl)), -- 2.39.5