From 80b3ff0ef7f6b7e095d077d5b6f678eb130d8a68 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 9 Sep 2014 13:36:37 -0400 Subject: [PATCH] mon: OSDMonitor sends maps over connection Signed-off-by: Casey Bodley Signed-off-by: Matt Benjamin --- src/mon/OSDMonitor.cc | 11 ++++++----- src/mon/OSDMonitor.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 97ed96e9d2b9..f2d4b3e67da4 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -1889,10 +1889,11 @@ void OSDMonitor::send_incremental(PaxosServiceMessage *req, epoch_t first) osd_epoch[osd] = last; } -void OSDMonitor::send_incremental(epoch_t first, entity_inst_t& dest, bool onetime) +void OSDMonitor::send_incremental(epoch_t first, MonSession *session, + bool onetime) { dout(5) << "send_incremental [" << first << ".." << osdmap.get_epoch() << "]" - << " to " << dest << dendl; + << " to " << session->inst << dendl; if (first < get_first_committed()) { first = get_first_committed(); @@ -1908,14 +1909,14 @@ void OSDMonitor::send_incremental(epoch_t first, entity_inst_t& dest, bool oneti m->oldest_map = first; m->newest_map = osdmap.get_epoch(); m->maps[first] = bl; - mon->messenger->send_message(m, dest); + session->con->send_message(m); first++; } while (first <= osdmap.get_epoch()) { epoch_t last = MIN(first + g_conf->osd_map_message_max, osdmap.get_epoch()); MOSDMap *m = build_incremental(first, last); - mon->messenger->send_message(m, dest); + session->con->send_message(m); first = last + 1; if (onetime) break; @@ -1953,7 +1954,7 @@ void OSDMonitor::check_sub(Subscription *sub) << (sub->onetime ? " (onetime)":" (ongoing)") << dendl; if (sub->next <= osdmap.get_epoch()) { if (sub->next >= 1) - send_incremental(sub->next, sub->session->inst, sub->incremental_onetime); + send_incremental(sub->next, sub->session, sub->incremental_onetime); else sub->session->con->send_message(build_latest_full()); if (sub->onetime) diff --git a/src/mon/OSDMonitor.h b/src/mon/OSDMonitor.h index 3f9d578e4adb..fa45ab985811 100644 --- a/src/mon/OSDMonitor.h +++ b/src/mon/OSDMonitor.h @@ -217,7 +217,7 @@ private: MOSDMap *build_incremental(epoch_t first, epoch_t last); void send_full(PaxosServiceMessage *m); void send_incremental(PaxosServiceMessage *m, epoch_t first); - void send_incremental(epoch_t first, entity_inst_t& dest, bool onetime); + void send_incremental(epoch_t first, MonSession *session, bool onetime); int reweight_by_utilization(int oload, std::string& out_str, bool by_pg, const set *pools); -- 2.47.3