From 7744fc69207b2042297abfebbdbe8846291897b4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 22 Aug 2019 10:41:34 -0500 Subject: [PATCH] osd/PeeringState: remove old info_map member Signed-off-by: Sage Weil --- src/osd/OSD.cc | 28 ---------------------------- src/osd/OSD.h | 2 -- src/osd/PeeringState.cc | 4 +--- src/osd/PeeringState.h | 14 -------------- 4 files changed, 1 insertion(+), 47 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 1becc78a93a85..ef38715637f17 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -9262,8 +9262,6 @@ void OSD::dispatch_context(PeeringCtx &ctx, PG *pg, OSDMapRef curmap, } else if (!is_active()) { dout(20) << __func__ << " not active" << dendl; } else { - do_infos(ctx.info_map, curmap); - for (auto& [osd, ls] : ctx.message_map) { if (!curmap->is_up(osd)) { dout(20) << __func__ << " skipping down osd." << osd << dendl; @@ -9292,32 +9290,6 @@ void OSD::dispatch_context(PeeringCtx &ctx, PG *pg, OSDMapRef curmap, } } -void OSD::do_infos(map>& info_map, - OSDMapRef curmap) -{ - for (auto& [osd, notifies] : info_map) { - if (!curmap->is_up(osd)) { - dout(20) << __func__ << " skipping down osd." << osd << dendl; - continue; - } - for (auto& i : notifies) { - dout(20) << __func__ << " sending info " << i.info - << " to osd " << osd << dendl; - } - ConnectionRef con = service.get_con_osd_cluster( - osd, curmap->get_epoch()); - if (!con) { - dout(20) << __func__ << " skipping osd." << osd << " (NULL con)" << dendl; - continue; - } - service.maybe_share_map(con.get(), curmap); - MOSDPGInfo *m = new MOSDPGInfo(curmap->get_epoch()); - m->pg_list = std::move(notifies); - con->send_message(m); - } - info_map.clear(); -} - void OSD::handle_fast_pg_create(MOSDPGCreate2 *m) { dout(7) << __func__ << " " << *m << " from " << m->get_source() << dendl; diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 2a309cdd49e23..534d083d48d9b 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1916,8 +1916,6 @@ protected: void dispatch_context(PeeringCtx &ctx, PG *pg, OSDMapRef curmap, ThreadPool::TPHandle *handle = NULL); void discard_context(PeeringCtx &ctx); - void do_infos(map>& info_map, - OSDMapRef map); bool require_mon_peer(const Message *m); bool require_mon_or_mgr_peer(const Message *m); diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index feb4d1fc513f5..5edd97a852e8f 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -20,10 +20,8 @@ #define dout_subsys ceph_subsys_osd BufferedRecoveryMessages::BufferedRecoveryMessages(PeeringCtx &ctx) - : info_map(std::move(ctx.info_map)), - message_map(std::move(ctx.message_map)) + : message_map(std::move(ctx.message_map)) { - ctx.info_map.clear(); ctx.message_map.clear(); } diff --git a/src/osd/PeeringState.h b/src/osd/PeeringState.h index ca66589917779..4a6f69a5e7dac 100644 --- a/src/osd/PeeringState.h +++ b/src/osd/PeeringState.h @@ -51,18 +51,12 @@ class PeeringCtx; // [primary only] content recovery state struct BufferedRecoveryMessages { - map> info_map; map> message_map; BufferedRecoveryMessages() = default; BufferedRecoveryMessages(PeeringCtx &); void accept_buffered_messages(BufferedRecoveryMessages &m) { - for (auto &[target, ivec] : m.info_map) { - auto &ovec = info_map[target]; - ovec.reserve(ovec.size() + ivec.size()); - ovec.insert(ovec.end(), ivec.begin(), ivec.end()); - } for (auto &[target, ls] : m.message_map) { auto &ovec = message_map[target]; // put buffered messages in front @@ -200,19 +194,16 @@ struct PeeringCtx : BufferedRecoveryMessages { struct PeeringCtxWrapper { utime_t start_time; BufferedRecoveryMessages &msgs; - map> &info_map; ObjectStore::Transaction &transaction; HBHandle * const handle = nullptr; PeeringCtxWrapper(PeeringCtx &wrapped) : msgs(wrapped), - info_map(wrapped.info_map), transaction(wrapped.transaction), handle(wrapped.handle) {} PeeringCtxWrapper(BufferedRecoveryMessages &buf, PeeringCtx &wrapped) : msgs(buf), - info_map(buf.info_map), transaction(wrapped.transaction), handle(wrapped.handle) {} @@ -573,11 +564,6 @@ public: return state->rctx->transaction; } - map> &get_info_map() { - ceph_assert(state->rctx); - return state->rctx->info_map; - } - PeeringCtxWrapper &get_recovery_ctx() { assert(state->rctx); return *(state->rctx); -- 2.39.5