]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: optimization some judgment and adjust the debug remove value in register_new_pgs 14046/head
authorsongbaisen <song.baisen@zte.com.cn>
Mon, 20 Mar 2017 11:31:37 +0000 (19:31 +0800)
committersongbaisen <song.baisen@zte.com.cn>
Mon, 17 Apr 2017 06:53:26 +0000 (06:53 +0000)
Signed-off-by: song baisen <song.baisen@zte.com.cn>
src/mgr/ClusterState.cc
src/mon/PGMap.cc

index a000408652533ae3f492a94fc8fe726af2a8a33d..7693a252910e5a6edf20b6ff680c1d6bea83e6c5 100644 (file)
@@ -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;
index df71843782270d7c69ae00f8a6a7f7fad2807558..4a64aefa49e59e9d90f8b7f6e6033a8954c98b88 100644 (file)
@@ -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;