From 2fc2261e16e04ec3598cab039dcb7f85da795b62 Mon Sep 17 00:00:00 2001 From: Cory Snyder Date: Wed, 17 Nov 2021 13:07:45 -0500 Subject: [PATCH] osd/OSDMap.cc: clean up pg_temp for nonexistent pgs 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 (cherry picked from commit 86367ea008281cf4398073466f3ece5ea18e82af) --- src/osd/OSDMap.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 02a2e3d53cdde..94164cc3bae02 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -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) { -- 2.39.5