]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PeeringState: remove old info_map member
authorSage Weil <sage@redhat.com>
Thu, 22 Aug 2019 15:41:34 +0000 (10:41 -0500)
committerSage Weil <sage@redhat.com>
Mon, 9 Sep 2019 16:22:11 +0000 (11:22 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h
src/osd/PeeringState.cc
src/osd/PeeringState.h

index 1becc78a93a856cf41f7660d019c3a85133cd288..ef38715637f1763dcdabfd55e3d40b26acba00cc 100644 (file)
@@ -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<int,vector<pg_notify_t>>& 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;
index 2a309cdd49e23bd43393a7449293b65d858de73f..534d083d48d9b04659b2970f227754be9eca32da 100644 (file)
@@ -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<int,vector<pg_notify_t>>& info_map,
-               OSDMapRef map);
 
   bool require_mon_peer(const Message *m);
   bool require_mon_or_mgr_peer(const Message *m);
index feb4d1fc513f56294baa8fac25f9c7e135cb680a..5edd97a852e8f88c3654ffa5d6e82b39887579f9 100644 (file)
 #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();
 }
 
index ca66589917779bfb536b6bb353254b6ec97e5bfc..4a6f69a5e7dac5998c6e8f7f5e6b01ace549c4dc 100644 (file)
@@ -51,18 +51,12 @@ class PeeringCtx;
 
 // [primary only] content recovery state
 struct BufferedRecoveryMessages {
-  map<int, vector<pg_notify_t>> info_map;
   map<int, vector<MessageRef>> 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<int, vector<pg_notify_t>> &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<int, vector<pg_notify_t>> &get_info_map() {
-      ceph_assert(state->rctx);
-      return state->rctx->info_map;
-    }
-
     PeeringCtxWrapper &get_recovery_ctx() {
       assert(state->rctx);
       return *(state->rctx);