From: Mohit Agrawal Date: Tue, 9 Jul 2024 04:35:38 +0000 (+0530) Subject: osdmon: Remove any pg_upmap_primary mapping during remove a pool X-Git-Tag: v20.0.0~1352^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F58470%2Fhead;p=ceph.git osdmon: Remove any pg_upmap_primary mapping during remove a pool The pg_upmap_primary items are not deleted after the pool is deleted from the cluster. Fixes: https://tracker.ceph.com/issues/66867 Signed-off-by: Mohit Agrawal --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index b70fcc064dd8..01a0529f79e8 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -14629,6 +14629,25 @@ int OSDMonitor::_prepare_remove_pool( } } } + // remove any old pg_upmap_primary mapping for this pool + for (auto& p : osdmap.pg_upmap_primaries) { + if (p.first.pool() == pool) { + dout(10) << __func__ << " " << pool + << " removing obsolete pg_upmap_primaries " << p.first + << dendl; + pending_inc.old_pg_upmap_primary.insert(p.first); + } + } + + // remove any pending pg_upmap_primary mapping for this pool + for (auto& p : osdmap.pg_upmap_primaries) { + if (p.first.pool() == pool) { + dout(10) << __func__ << " " << pool + << " removing pending pg_upmap_primaries " << p.first + << dendl; + pending_inc.new_pg_upmap_primary.erase(p.first); + } + } // remove any choose_args for this pool CrushWrapper newcrush = _get_pending_crush();