]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: kill direct references to pgmon from OSDMonitor
authorGreg Farnum <gfarnum@redhat.com>
Thu, 4 May 2017 19:45:25 +0000 (12:45 -0700)
committerSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 16:59:14 +0000 (12:59 -0400)
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 <gfarnum@redhat.com>
src/mon/OSDMonitor.cc
src/mon/PGStatService.h

index c310997da2b5e0cdd66a8f5ab46a22f4bbca779e..6728a9d9b279973c405ae004e64eef526dc4eb78 100644 (file)
@@ -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<pair<health_status_t,string> >& summary,
       }
 
       map<int, float> 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<int32_t, uint32_t> new_weights;
     err = reweight::by_utilization(osdmap,
-                                  mon->pgmon()->pg_map,
+                                  mon->pgservice.get_pg_map(),
                                   oload,
                                   max_change,
                                   max_osds,
index 76e78bd3367cb986d1822c4e5530c783ebf6729b..656b44cbc9fac2c3386005a80ae06b490bac2dad 100644 (file)
@@ -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
    */