From: Patrick Donnelly Date: Fri, 27 Oct 2017 20:20:07 +0000 (-0700) Subject: MDSMonitor: wait for readable OSDMap before sanitizing X-Git-Tag: v12.2.2~42^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=555746a09e8bb7bcf99da91f9d00dfab9791d80c;p=ceph.git MDSMonitor: wait for readable OSDMap before sanitizing Fixes: http://tracker.ceph.com/issues/21945 Signed-off-by: Patrick Donnelly (cherry picked from commit ca52f3bd93e6c743aa05171108527d877807b426) --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 985c78b88dc..dd8db062ad4 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -111,8 +111,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; @@ -135,6 +133,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; }