From: Radoslaw Zarzynski Date: Thu, 9 May 2024 19:07:32 +0000 (+0000) Subject: osd: abstract sending MOSDPGPush during EC recovery X-Git-Tag: v21.0.0~50^2~122^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1d54eaff41ec8d880bcf9149e4c71114e0ffdc09;p=ceph.git osd: abstract sending MOSDPGPush during EC recovery Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index 2d56e180ae0f..09998b74e6ca 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 7055318fba92..ac9048d866f6 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 76fd03c6d662..fd9e37a682fe 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 3dcaaa9b46bd..d41ee4641f48 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 ca299abd9631..c134ac042a42 100644 --- a/src/test/osd/TestECBackend.cc +++ b/src/test/osd/TestECBackend.cc @@ -462,6 +462,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;