Skip to content

Commit

Permalink
Merge PR ceph#23984 into master
Browse files Browse the repository at this point in the history
* refs/pull/23984/head:
	mon: test if gid exists in pending for prepare_beacon

Reviewed-by: Sage Weil <[email protected]>
Reviewed-by: Greg Farnum <[email protected]>
  • Loading branch information
batrick committed Sep 7, 2018
2 parents 09ee3f3 + f26752a commit 17f79b0
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/mon/MDSMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,31 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
update_metadata(m->get_global_id(), m->get_sys_info());
} else {
// state update

if (!pending.gid_exists(gid)) {
/* gid has been removed from pending, send null map */
dout(5) << "mds_beacon " << *m << " is not in fsmap (state "
<< ceph_mds_state_name(state) << ")" << dendl;

/* We can't send an MDSMap this MDS was a part of because we no longer
* know which FS it was part of. Nor does this matter. Sending an empty
* MDSMap is sufficient for getting the MDS to respawn.
*/
wait_for_finished_proposal(op, new FunctionContext([op, this](int r){
if (r >= 0) {
const auto& fsmap = get_fsmap();
MDSMap null_map;
null_map.epoch = fsmap.epoch;
null_map.compat = fsmap.compat;
auto m = MMDSMap::create(mon->monmap->fsid, null_map);
mon->send_reply(op, m.detach());
} else {
dispatch(op); // try again
}
}));
return true;
}

const MDSMap::mds_info_t &info = pending.get_info_gid(gid);
// Old MDS daemons don't mention that they're standby replay until
// after they've sent their boot beacon, so update this field.
Expand Down

0 comments on commit 17f79b0

Please sign in to comment.