]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/ClusterState: do not mangle PGMap outside of Incremental 16262/head
authorSage Weil <sage@redhat.com>
Tue, 11 Jul 2017 15:34:30 +0000 (11:34 -0400)
committerSage Weil <sage@redhat.com>
Tue, 11 Jul 2017 15:35:24 +0000 (11:35 -0400)
Fixes: http://tracker.ceph.com/issues/20208
Signed-off-by: Sage Weil <sage@redhat.com>
src/mgr/ClusterState.cc

index 6dee866c7d81166de063836047294c3d91094de3..7e01a811ef158b67da452faad8f8e3ed55c6c5a3 100644 (file)
@@ -98,10 +98,12 @@ void ClusterState::ingest_pgstats(MPGStats *stats)
     }
     // In case we already heard about more recent stats from this PG
     // from another OSD
-    if (pg_map.pg_stat[pgid].get_version_pair() > pg_stats.get_version_pair()) {
+    const auto q = pg_map.pg_stat.find(pgid);
+    if (q != pg_map.pg_stat.end() &&
+       q->second.get_version_pair() > pg_stats.get_version_pair()) {
       dout(15) << " had " << pgid << " from "
-              << pg_map.pg_stat[pgid].reported_epoch << ":"
-               << pg_map.pg_stat[pgid].reported_seq << dendl;
+              << q->second.reported_epoch << ":"
+               << q->second.reported_seq << dendl;
       continue;
     }