]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PG: tolerate missing pool
authorSage Weil <sage@redhat.com>
Sat, 9 Dec 2017 21:26:48 +0000 (15:26 -0600)
committerSage Weil <sage@redhat.com>
Thu, 11 Jan 2018 23:07:00 +0000 (17:07 -0600)
These assertions will soon no longer be valid.

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

index 07cc701eb7fdd10940f7fc0bfefc34b9ed8116fa..b851b63dd61fb0fb8d99279d574975268d72e943 100644 (file)
@@ -7900,7 +7900,8 @@ void OSD::advance_pg(
     // Check for split!
     set<spg_t> children;
     spg_t parent(pg->pg_id);
-    if (parent.is_split(
+    if (nextmap->have_pg_pool(pg->pg_id.pool()) &&
+       parent.is_split(
          lastmap->get_pg_num(pg->pg_id.pool()),
          nextmap->get_pg_num(pg->pg_id.pool()),
          &children)) {
index 4beaf7fb6d1a5366869a91e8f375dc556f41c7cc..5154ccae799195c27044e2617e5e339c7e2d9ea8 100644 (file)
@@ -227,7 +227,9 @@ void PG::dump_live_ids()
 void PGPool::update(CephContext *cct, OSDMapRef map)
 {
   const pg_pool_t *pi = map->get_pg_pool(id);
-  assert(pi);
+  if (!pi) {
+    return; // pool has been deleted
+  }
   info = *pi;
   auid = pi->auid;
   name = map->get_pool_name(id);
@@ -5253,7 +5255,9 @@ void PG::check_full_transition(OSDMapRef lastmap, OSDMapRef osdmap)
     changed = true;
   }
   const pg_pool_t *pi = osdmap->get_pg_pool(info.pgid.pool());
-  assert(pi);
+  if (!pi) {
+    return; // pool deleted
+  }
   if (pi->has_flag(pg_pool_t::FLAG_FULL)) {
     const pg_pool_t *opi = lastmap->get_pg_pool(info.pgid.pool());
     if (!opi || !opi->has_flag(pg_pool_t::FLAG_FULL)) {
@@ -5455,7 +5459,8 @@ void PG::start_peering_interval(
       dirty_info = true;
       dirty_big_info = true;
       info.history.same_interval_since = osdmap->get_epoch();
-      if (info.pgid.pgid.is_split(lastmap->get_pg_num(info.pgid.pgid.pool()),
+      if (osdmap->have_pg_pool(info.pgid.pgid.pool()) &&
+         info.pgid.pgid.is_split(lastmap->get_pg_num(info.pgid.pgid.pool()),
                                  osdmap->get_pg_num(info.pgid.pgid.pool()),
                                  nullptr)) {
        info.history.last_epoch_split = osdmap->get_epoch();