]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdmon: Remove any pg_upmap_primary mapping during remove a pool 58914/head
authorMohit Agrawal <moagrawa@redhat.com>
Tue, 9 Jul 2024 04:35:38 +0000 (10:05 +0530)
committerLaura Flores <lflores@ibm.com>
Mon, 19 Aug 2024 21:40:28 +0000 (16:40 -0500)
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>
(cherry picked from commit ccb292c818b8e9fe8de04a745b75d97430764e1b)

src/mon/OSDMonitor.cc

index 7bfd4e2cacc4fe0e940d5bafb6bc08fb1ed632e2..ab50544f9521b1308ebcdc32eb9b72919dd75402 100644 (file)
@@ -14634,6 +14634,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();