]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: disallow new upmaps on pgs that are pending merge 25652/head
authorSage Weil <sage@redhat.com>
Thu, 20 Dec 2018 16:03:10 +0000 (10:03 -0600)
committerSage Weil <sage@redhat.com>
Fri, 21 Dec 2018 00:46:47 +0000 (18:46 -0600)
It's critical that we keep the source and target PGs mapped to
the same place.  Prevent new pg_upmaps on merge source or target
PGs.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSDMap.cc

index 676638fdfbc4323a31191cea41967794b447a530..30edcfebd1c13eca67d4410709658a55ded60abe 100644 (file)
@@ -1755,8 +1755,16 @@ void OSDMap::maybe_remove_pg_upmaps(CephContext *cct,
     to_check.insert(p.first);
   }
   for (auto& pg : to_check) {
-    if (!nextmap.pg_exists(pg)) {
-      ldout(cct, 0) << __func__ << " pg " << pg << " is gone" << dendl;
+    const pg_pool_t *pi = nextmap.get_pg_pool(pg.pool());
+    if (!pi || pg.ps() >= pi->get_pg_num_pending()) {
+      ldout(cct, 0) << __func__ << " pg " << pg << " is gone or merge source"
+                   << dendl;
+      to_cancel.insert(pg);
+      continue;
+    }
+    if (pi->is_pending_merge(pg, nullptr)) {
+      ldout(cct, 0) << __func__ << " pg " << pg << " is pending merge"
+                   << dendl;
       to_cancel.insert(pg);
       continue;
     }