]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap.cc: clean up pg_temp for nonexistent pgs 44097/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:28 +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 02a2e3d53cdde30f90f7f96a3d212eb99d3cdcc2..94164cc3bae02da552565f9d94699f8c92d4c9ae 100644 (file)
@@ -1779,6 +1779,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) {