]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
MDSMonitor: wait for readable OSDMap before sanitizing 18603/head
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 27 Oct 2017 20:20:07 +0000 (13:20 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 27 Oct 2017 20:49:21 +0000 (13:49 -0700)
Fixes: http://tracker.ceph.com/issues/21945
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mon/MDSMonitor.cc

index c79790b6f0c5f11fa35bdf52191fddc4b91b0b54..386e56c187086be1496dddde9e171f2c3a145055 100644 (file)
@@ -117,8 +117,6 @@ void MDSMonitor::update_from_paxos(bool *need_bootstrap)
   assert(fsmap_bl.length() > 0);
   dout(10) << __func__ << " got " << version << dendl;
   fsmap.decode(fsmap_bl);
-  auto &osdmap = mon->osdmon()->osdmap;
-  fsmap.sanitize([&osdmap](int64_t pool){return osdmap.have_pg_pool(pool);});
 
   // new map
   dout(4) << "new map" << dendl;
@@ -140,6 +138,11 @@ void MDSMonitor::create_pending()
   pending_fsmap = fsmap;
   pending_fsmap.epoch++;
 
+  if (mon->osdmon()->is_readable()) {
+    auto &osdmap = mon->osdmon()->osdmap;
+    pending_fsmap.sanitize([&osdmap](int64_t pool){return osdmap.have_pg_pool(pool);});
+  }
+
   dout(10) << "create_pending e" << pending_fsmap.epoch << dendl;
 }