]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osdmon: Remove any pg_upmap_primary mapping during remove a pool
authorMohit Agrawal <moagrawa@redhat.com>
Tue, 9 Jul 2024 04:35:38 +0000 (10:05 +0530)
committerLaura Flores <lflores@ibm.com>
Tue, 30 Jul 2024 02:59:33 +0000 (02:59 +0000)
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 <moagrawa@redhat.com>
src/mon/OSDMonitor.cc

index b70fcc064dd80f7f5548294366c33e006aa41cda..01a0529f79e8b10416c8213bd8fc20abeed53063 100644 (file)
@@ -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();