From ccb292c818b8e9fe8de04a745b75d97430764e1b Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Tue, 9 Jul 2024 10:05:38 +0530 Subject: [PATCH] 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 --- src/mon/OSDMonitor.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index b70fcc064dd..01a0529f79e 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(); -- 2.39.5