From b37e959238e75690d38873744515fa54413f4393 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 12 Mar 2021 14:51:30 +0800 Subject: [PATCH] osd: do not handle pre-octopus messages MOSDPGQuery and MOSDPGInfo messages are sent by pre-octopus OSD, so in quincy and up clusters, we do not need to handle them anymore, as we can only upgrade from octopus and up to quincy. we can drop MOSDPGNotify after Q + 2, though, after we stop sending MOSDPGNotify in Q release. Signed-off-by: Kefu Chai --- src/osd/OSD.cc | 56 -------------------------------------------------- src/osd/OSD.h | 4 ---- 2 files changed, 60 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index a737b394a289a..5ef08cd5f4b4d 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -92,11 +92,9 @@ #include "messages/MMonGetOSDMap.h" #include "messages/MOSDPGNotify.h" #include "messages/MOSDPGNotify2.h" -#include "messages/MOSDPGQuery.h" #include "messages/MOSDPGQuery2.h" #include "messages/MOSDPGLog.h" #include "messages/MOSDPGRemove.h" -#include "messages/MOSDPGInfo.h" #include "messages/MOSDPGInfo2.h" #include "messages/MOSDPGCreate.h" #include "messages/MOSDPGCreate2.h" @@ -7137,18 +7135,12 @@ void OSD::ms_fast_dispatch(Message *m) case MSG_OSD_SCRUB2: handle_fast_scrub(static_cast(m)); return; - case MSG_OSD_PG_CREATE2: return handle_fast_pg_create(static_cast(m)); - case MSG_OSD_PG_QUERY: - return handle_fast_pg_query(static_cast(m)); case MSG_OSD_PG_NOTIFY: return handle_fast_pg_notify(static_cast(m)); - case MSG_OSD_PG_INFO: - return handle_fast_pg_info(static_cast(m)); case MSG_OSD_PG_REMOVE: return handle_fast_pg_remove(static_cast(m)); - // these are single-pg messages that handle themselves case MSG_OSD_PG_LOG: case MSG_OSD_PG_TRIM: @@ -9351,31 +9343,6 @@ void OSD::handle_fast_pg_create(MOSDPGCreate2 *m) m->put(); } -void OSD::handle_fast_pg_query(MOSDPGQuery *m) -{ - dout(7) << __func__ << " " << *m << " from " << m->get_source() << dendl; - if (!require_osd_peer(m)) { - m->put(); - return; - } - int from = m->get_source().num(); - for (auto& p : m->pg_list) { - enqueue_peering_evt( - p.first, - PGPeeringEventRef( - std::make_shared( - p.second.epoch_sent, p.second.epoch_sent, - MQuery( - p.first, - pg_shard_t(from, p.second.from), - p.second, - p.second.epoch_sent), - false)) - ); - } - m->put(); -} - void OSD::handle_fast_pg_notify(MOSDPGNotify* m) { dout(7) << __func__ << " " << *m << " from " << m->get_source() << dendl; @@ -9408,29 +9375,6 @@ void OSD::handle_fast_pg_notify(MOSDPGNotify* m) m->put(); } -void OSD::handle_fast_pg_info(MOSDPGInfo* m) -{ - dout(7) << __func__ << " " << *m << " from " << m->get_source() << dendl; - if (!require_osd_peer(m)) { - m->put(); - return; - } - int from = m->get_source().num(); - for (auto& p : m->pg_list) { - enqueue_peering_evt( - spg_t(p.info.pgid.pgid, p.to), - PGPeeringEventRef( - std::make_shared( - p.epoch_sent, p.query_epoch, - MInfoRec( - pg_shard_t(from, p.from), - p.info, - p.epoch_sent))) - ); - } - m->put(); -} - void OSD::handle_fast_pg_remove(MOSDPGRemove *m) { dout(7) << __func__ << " " << *m << " from " << m->get_source() << dendl; diff --git a/src/osd/OSD.h b/src/osd/OSD.h index b5944c5a515bd..bd127285a1551 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -85,9 +85,7 @@ struct C_OpenPGs; class LogChannel; class MOSDPGCreate2; -class MOSDPGQuery; class MOSDPGNotify; -class MOSDPGInfo; class MOSDPGRemove; class MOSDForceRecovery; class MMonGetPurgedSnapsReply; @@ -1918,11 +1916,9 @@ protected: bool is_fast_dispatch); void handle_fast_pg_create(MOSDPGCreate2 *m); - void handle_fast_pg_query(MOSDPGQuery *m); void handle_pg_query_nopg(const MQuery& q); void handle_fast_pg_notify(MOSDPGNotify *m); void handle_pg_notify_nopg(const MNotifyRec& q); - void handle_fast_pg_info(MOSDPGInfo *m); void handle_fast_pg_remove(MOSDPGRemove *m); public: -- 2.39.5