// In case we're hearing about a PG that according to last
// OSDMap update should not exist
- if (existing_pools.count(pgid.pool()) == 0) {
+ auto r = existing_pools.find(pgid.pool());
+ if (r == existing_pools.end()) {
dout(15) << " got " << pgid
<< " reported at " << pg_stats.reported_epoch << ":"
<< pg_stats.reported_seq
<< dendl;
continue;
}
+ if (pgid.ps() >= r->second) {
+ dout(15) << " got " << pgid
+ << " reported at " << pg_stats.reported_epoch << ":"
+ << pg_stats.reported_seq
+ << " state " << pg_state_string(pg_stats.state)
+ << " but > pg_num " << r->second
+ << dendl;
+ continue;
+ }
// In case we already heard about more recent stats from this PG
// from another OSD
const auto q = pg_map.pg_stat.find(pgid);
q->second.get_version_pair() > pg_stats.get_version_pair()) {
dout(15) << " had " << pgid << " from "
<< q->second.reported_epoch << ":"
- << q->second.reported_seq << dendl;
+ << q->second.reported_seq << dendl;
continue;
}
// in synchrony with this OSDMap.
existing_pools.clear();
for (auto& p : osd_map.get_pools()) {
- existing_pools.insert(p.first);
+ existing_pools[p.first] = p.second.get_pg_num();
}
// brute force this for now (don't bother being clever by only
MgrMap mgr_map;
- set<int64_t> existing_pools; ///< pools that exist, as of PGMap epoch
+ map<int64_t,unsigned> existing_pools; ///< pools that exist, and pg_num, as of PGMap epoch
PGMap pg_map;
PGMap::Incremental pending_inc;