From: Sage Weil Date: Mon, 30 Jul 2018 03:23:06 +0000 (-0500) Subject: mgr/ClusterState: discard pg updates for pgs >= pg_num X-Git-Tag: v14.0.1~371^2~30 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9e906733fe07925f6956a592e2718000f62fef93;p=ceph-ci.git mgr/ClusterState: discard pg updates for pgs >= pg_num Signed-off-by: Sage Weil --- diff --git a/src/mgr/ClusterState.cc b/src/mgr/ClusterState.cc index d9eed6d4dfb..436b53f8f9d 100644 --- a/src/mgr/ClusterState.cc +++ b/src/mgr/ClusterState.cc @@ -78,7 +78,8 @@ void ClusterState::ingest_pgstats(MPGStats *stats) // 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 @@ -87,6 +88,15 @@ void ClusterState::ingest_pgstats(MPGStats *stats) << 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); @@ -94,7 +104,7 @@ void ClusterState::ingest_pgstats(MPGStats *stats) 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; } @@ -137,7 +147,7 @@ void ClusterState::notify_osdmap(const OSDMap &osd_map) // 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 diff --git a/src/mgr/ClusterState.h b/src/mgr/ClusterState.h index d0ec594cc40..a22c058dec7 100644 --- a/src/mgr/ClusterState.h +++ b/src/mgr/ClusterState.h @@ -43,7 +43,7 @@ protected: MgrMap mgr_map; - set existing_pools; ///< pools that exist, as of PGMap epoch + map existing_pools; ///< pools that exist, and pg_num, as of PGMap epoch PGMap pg_map; PGMap::Incremental pending_inc;