Skip to content

Commit

Permalink
Merge pull request ceph#18603 from batrick/i21945
Browse files Browse the repository at this point in the history
mon/MDSMonitor: wait for readable OSDMap before sanitizing

Reviewed-by: Kefu Chai <[email protected]>
Reviewed-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas authored Oct 30, 2017
2 parents 456b68c + ca52f3b commit ce6ba63
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mon/MDSMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down

0 comments on commit ce6ba63

Please sign in to comment.