]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdmon: Remove any pg_upmap_primary mapping during remove a pool 59270/head
authorMohit Agrawal <moagrawa@redhat.com>
Tue, 9 Jul 2024 04:35:38 +0000 (10:05 +0530)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Fri, 25 Oct 2024 15:44:20 +0000 (22:44 +0700)
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 baf74516307723b737780b8f63f1deeb4d633f96..eb6e990007c1edcea5b76146fea3f2793744c432 100644 (file)
@@ -14670,6 +14670,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();