Skip to content

Commit

Permalink
mon: kill direct references to pgmon from OSDMonitor
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
gregsfortytwo authored and liewegas committed Jun 2, 2017
1 parent d8cd319 commit 8e9b109
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)";
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -9231,7 +9231,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
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,
Expand Down
1 change: 1 addition & 0 deletions src/mon/PGStatService.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class PGStatService : public PGMap {
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
*/
Expand Down

0 comments on commit 8e9b109

Please sign in to comment.