]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap.cc: clean up pg_temp for nonexistent pgs 43989/head
authorCory Snyder <csnyder@iland.com>
Wed, 17 Nov 2021 18:07:45 +0000 (13:07 -0500)
committerCory Snyder <csnyder@iland.com>
Wed, 17 Nov 2021 18:16:54 +0000 (13:16 -0500)
Fixes an issue where the OSDMap does not clear pg-temp entries for PGs that no longer exist.

Fixes: https://tracker.ceph.com/issues/53308
Signed-off-by: Cory Snyder <csnyder@iland.com>
src/osd/OSDMap.cc

index 9a380eae8719bf32146b210f3a89b9a51dfc1dac..f0096d32bee545f02bf327ba9a808130886ca17e 100644 (file)
@@ -1807,6 +1807,12 @@ void OSDMap::clean_temps(CephContext *cct,
       pending_inc->new_pg_temp[pg.first].clear();
       continue;
     }
+    if (!nextmap.pg_exists(pg.first)) {
+      ldout(cct, 10) << __func__ << " removing pg_temp " << pg.first
+                     << " for nonexistent pg " << dendl;
+      pending_inc->new_pg_temp[pg.first].clear();
+      continue;
+    }
     // all osds down?
     unsigned num_up = 0;
     for (auto o : pg.second) {