]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: handle data pools missing from osdmap
authorJohn Spray <john.spray@redhat.com>
Wed, 15 Jul 2015 12:45:06 +0000 (13:45 +0100)
committerJohn Spray <john.spray@redhat.com>
Tue, 28 Jul 2015 08:05:08 +0000 (09:05 +0100)
This case happens on rank acquisition because we
see the MDSMap before the OSDMap, as the continuous
watch on OSDMaps doesn't happen when we're in standby.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/StrayManager.cc

index e57d6293afac9dd19e358e0b7e4f016d4bf5779e..ae05d740ab3c8dcc3c629e3685d204080184552c 100644 (file)
@@ -866,12 +866,21 @@ void StrayManager::handle_conf_change(const struct md_config_t *conf,
 void StrayManager::update_op_limit()
 {
   const OSDMap *osdmap = mds->objecter->get_osdmap_read();
+  assert(osdmap != NULL);
 
   // Number of PGs across all data pools
   uint64_t pg_count = 0;
   const std::set<int64_t> &data_pools = mds->mdsmap->get_data_pools();
   for (std::set<int64_t>::iterator i = data_pools.begin();
        i != data_pools.end(); ++i) {
+    if (osdmap->get_pg_pool(*i) == NULL) {
+      // It is possible that we have an older OSDMap than MDSMap, because
+      // we don't start watching every OSDMap until after MDSRank is
+      // initialized
+      dout(4) << __func__ << " data pool " << *i
+              << " not found in OSDMap" << dendl;
+      continue;
+    }
     pg_count += osdmap->get_pg_num(*i);
   }