]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap.cc: clean up pg_temp for nonexistent pgs 44096/head
authorCory Snyder <csnyder@iland.com>
Wed, 17 Nov 2021 18:07:45 +0000 (13:07 -0500)
committerCory Snyder <csnyder@iland.com>
Wed, 24 Nov 2021 17:29:09 +0000 (12:29 -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>
(cherry picked from commit 86367ea008281cf4398073466f3ece5ea18e82af)

src/osd/OSDMap.cc

index 433ad3b41314d62cfecd9b376899137fb4695200..4a74aec57543141c4e9fc93e03167cf1dcb5aee9 100644 (file)
@@ -1809,6 +1809,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) {