From: Greg Farnum Date: Thu, 4 May 2017 19:45:25 +0000 (-0700) Subject: mon: kill direct references to pgmon from OSDMonitor X-Git-Tag: ses5-milestone6~8^2~19^2~115 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8e9b1093c222df8f03fe4e57f055d53227e030c9;p=ceph.git mon: kill direct references to pgmon from OSDMonitor The only one left now is where the OSDMonitor triggers PGMonitor::check_osd_map() and that's going to die post-Luminous, so no need to do anything fancy with it. Signed-off-by: Greg Farnum --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index c310997da2b..6728a9d9b27 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -931,7 +931,7 @@ OSDMonitor::update_pending_pgs(const OSDMap::Incremental& inc) if (pending_creatings.last_scan_epoch > inc.epoch) { return pending_creatings; } - const auto& pgm = mon->pgmon()->pg_map; + const auto& pgm = mon->pgservice.get_pg_map(); if (pgm.last_pg_scan >= creating_pgs.last_scan_epoch) { // TODO: please stop updating pgmap with pgstats once the upgrade is completed const unsigned total = pending_creatings.pgs.size(); @@ -1304,7 +1304,7 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t) if (osdmap.require_osd_release < CEPH_RELEASE_LUMINOUS) { dout(7) << __func__ << " in the middle of upgrading, " << " trimming pending creating_pgs using pgmap" << dendl; - trim_creating_pgs(&pending_creatings, mon->pgmon()->pg_map); + trim_creating_pgs(&pending_creatings, mon->pgservice.get_pg_map()); } bufferlist creatings_bl; ::encode(pending_creatings, creatings_bl); @@ -3686,7 +3686,7 @@ void OSDMonitor::get_health(list >& summary, } map full, backfillfull, nearfull; - osdmap.get_full_osd_util(mon->pgmon()->pg_map.osd_stat, &full, &backfillfull, &nearfull); + osdmap.get_full_osd_util(mon->pgservice.get_pg_map().osd_stat, &full, &backfillfull, &nearfull); if (full.size()) { ostringstream ss; ss << full.size() << " full osd(s)"; @@ -5025,7 +5025,7 @@ void OSDMonitor::update_pool_flags(int64_t pool_id, uint64_t flags) bool OSDMonitor::update_pools_status() { - if (!mon->pgmon()->is_readable()) + if (!mon->pgservice.is_readable()) return false; bool ret = false; @@ -9231,7 +9231,7 @@ done: string out_str; mempool::osdmap::map new_weights; err = reweight::by_utilization(osdmap, - mon->pgmon()->pg_map, + mon->pgservice.get_pg_map(), oload, max_change, max_osds, diff --git a/src/mon/PGStatService.h b/src/mon/PGStatService.h index 76e78bd3367..656b44cbc9f 100644 --- a/src/mon/PGStatService.h +++ b/src/mon/PGStatService.h @@ -43,6 +43,7 @@ public: parent = o; } + // FIXME: Kill this once we rip out PGMonitor post-luminous /** returns true if the underlying data is readable. Always true * post-luminous, but not when we are redirecting to the PGMonitor */