mirror of
https://github.com/ceph/ceph
synced 2025-02-24 03:27:10 +00:00
mon: PGMonitor: erase entries from 'creating_pgs_by_osd' when set is empty
This patch avoids sending empty MOSDPGCreate's every tick. Fixes: #3571 Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
This commit is contained in:
parent
e1c27fe178
commit
bc6f726825
@ -309,8 +309,11 @@ void PGMap::stat_pg_sub(const pg_t &pgid, const pg_stat_t &s)
|
||||
pg_sum.sub(s);
|
||||
if (s.state & PG_STATE_CREATING) {
|
||||
creating_pgs.erase(pgid);
|
||||
if (s.acting.size())
|
||||
if (s.acting.size()) {
|
||||
creating_pgs_by_osd[s.acting[0]].erase(pgid);
|
||||
if (creating_pgs_by_osd[s.acting[0]].size() == 0)
|
||||
creating_pgs_by_osd.erase(s.acting[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -775,8 +775,11 @@ void PGMonitor::send_pg_creates()
|
||||
vector<int> acting;
|
||||
int nrep = mon->osdmon()->osdmap.pg_to_acting_osds(on, acting);
|
||||
|
||||
if (s.acting.size())
|
||||
if (s.acting.size()) {
|
||||
pg_map.creating_pgs_by_osd[s.acting[0]].erase(pgid);
|
||||
if (pg_map.creating_pgs_by_osd[s.acting[0]].size() == 0)
|
||||
pg_map.creating_pgs_by_osd.erase(s.acting[0]);
|
||||
}
|
||||
s.acting = acting;
|
||||
|
||||
// don't send creates for localized pgs
|
||||
@ -812,6 +815,7 @@ void PGMonitor::send_pg_creates(int osd, Connection *con)
|
||||
map<int, set<pg_t> >::iterator p = pg_map.creating_pgs_by_osd.find(osd);
|
||||
if (p == pg_map.creating_pgs_by_osd.end())
|
||||
return;
|
||||
assert(p->second.size() > 0);
|
||||
|
||||
dout(20) << "send_pg_creates osd." << osd << " pgs " << p->second << dendl;
|
||||
MOSDPGCreate *m = new MOSDPGCreate(mon->osdmon()->osdmap.get_epoch());
|
||||
|
Loading…
Reference in New Issue
Block a user