From 8fb30980229457e088c561bf138b777278ea0932 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Thu, 9 May 2024 19:07:32 +0000 Subject: [PATCH] osd: abstract sending MOSDPGPush during EC recovery Signed-off-by: Radoslaw Zarzynski (cherry picked from commit 1d54eaff41ec8d880bcf9149e4c71114e0ffdc09) --- src/osd/ECBackend.cc | 5 +---- src/osd/ECCommon.h | 2 ++ src/osd/ECListener.h | 3 +++ src/osd/PrimaryLogPG.h | 7 +++++++ src/test/osd/TestECBackend.cc | 4 ++++ 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index b1ed418d388..51f785af7e4 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -490,10 +490,7 @@ void ECCommon::RecoveryBackend::dispatch_recovery_messages( msg->pushes.swap(i->second); msg->compute_cost(cct); msg->is_repair = get_parent()->pg_is_repair(); - std::vector wrapped_msg{ - std::make_pair(i->first.osd, static_cast(msg)) - }; - get_parent()->send_message_osd_cluster(wrapped_msg, msg->map_epoch); + get_parent()->send_message_osd_cluster(i->first.osd, msg, msg->map_epoch); } std::map replies; for (map>::iterator i = diff --git a/src/osd/ECCommon.h b/src/osd/ECCommon.h index 462e10a971b..66fbfde7398 100644 --- a/src/osd/ECCommon.h +++ b/src/osd/ECCommon.h @@ -21,6 +21,8 @@ #include "erasure-code/ErasureCodeInterface.h" #include "ECUtil.h" #include "ECTypes.h" +#include "messages/MOSDPGPushReply.h" +#include "msg/MessageRef.h" #if WITH_CRIMSON #include "crimson/osd/object_context.h" #include "os/Transaction.h" diff --git a/src/osd/ECListener.h b/src/osd/ECListener.h index 76fd03c6d66..fd9e37a682f 100644 --- a/src/osd/ECListener.h +++ b/src/osd/ECListener.h @@ -18,6 +18,7 @@ #include "OSDMap.h" #include "common/WorkQueue.h" #include "PGLog.h" +#include "messages/MOSDPGPush.h" // ECListener -- an interface decoupling the pipelines from // particular implementation of ECBackendL (crimson vs cassical). @@ -142,6 +143,8 @@ struct ECListener { // XXX virtual void send_message_osd_cluster( std::vector>& messages, epoch_t from_epoch) = 0; + virtual void send_message_osd_cluster( + int osd, MOSDPGPush* msg, epoch_t from_epoch) = 0; virtual std::ostream& gen_dbg_prefix(std::ostream& out) const = 0; diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index cd62052ef30..7418c3fd27f 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -612,6 +612,13 @@ public: int peer, Message *m, epoch_t from_epoch) override { osd->send_message_osd_cluster(peer, m, from_epoch); } + void send_message_osd_cluster( + int osd, MOSDPGPush* msg, epoch_t from_epoch) override { + std::vector wrapped_msg { + std::make_pair(osd, static_cast(msg)) + }; + send_message_osd_cluster(wrapped_msg, from_epoch); + } void send_message_osd_cluster( std::vector>& messages, epoch_t from_epoch) override { osd->send_message_osd_cluster(messages, from_epoch); diff --git a/src/test/osd/TestECBackend.cc b/src/test/osd/TestECBackend.cc index a554fe4c94e..c7e6e585a7f 100644 --- a/src/test/osd/TestECBackend.cc +++ b/src/test/osd/TestECBackend.cc @@ -461,6 +461,10 @@ public: } + void send_message_osd_cluster(int osd, MOSDPGPush* msg, epoch_t from_epoch) override { + + } + ostream &gen_dbg_prefix(ostream &out) const override { out << dbg_prefix; return out; -- 2.39.5