From: songbaisen Date: Mon, 20 Mar 2017 11:31:37 +0000 (+0800) Subject: mgr: optimization some judgment and adjust the debug remove value in register_new_pgs X-Git-Tag: v12.0.2~56^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3da07ea0a599c92f24053e5d6778fa2fda89a461;p=ceph.git mgr: optimization some judgment and adjust the debug remove value in register_new_pgs Signed-off-by: song baisen --- diff --git a/src/mgr/ClusterState.cc b/src/mgr/ClusterState.cc index a000408652533..7693a252910e5 100644 --- a/src/mgr/ClusterState.cc +++ b/src/mgr/ClusterState.cc @@ -76,12 +76,9 @@ void ClusterState::ingest_pgstats(MPGStats *stats) << " but DNE in pg_map; pool was probably deleted." << dendl; continue; - } - - // In case we already heard about more recent stats from this PG - // from another OSD - if (pg_map.pg_stat.count(pgid) && - pg_map.pg_stat[pgid].get_version_pair() > pg_stats.get_version_pair()) { + // In case we already heard about more recent stats from this PG + // from another OSD + } else if (pg_map.pg_stat[pgid].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; continue; diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index df71843782270..4a64aefa49e59 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -2262,9 +2262,8 @@ void PGMapUpdater::register_new_pgs( dout(20) << " removing creating_pg " << p << " because it is localized and obsolete" << dendl; pending_inc->pg_remove.insert(p); - removed++; - } - if (!osd_map.have_pg_pool(p.pool())) { + ++removed; + } else if (!osd_map.have_pg_pool(p.pool())) { dout(20) << " removing creating_pg " << p << " because containing pool deleted" << dendl; pending_inc->pg_remove.insert(p); @@ -2279,8 +2278,7 @@ void PGMapUpdater::register_new_pgs( << "containing pool deleted" << dendl; pending_inc->pg_remove.insert(p.first); ++removed; - } - if (p.first.preferred() >= 0) { + } else if (p.first.preferred() >= 0) { dout(20) << " removing localized pg " << p.first << dendl; pending_inc->pg_remove.insert(p.first); ++removed;