MDSMonitor: do not allow MDS to transition from STATE_STOPPING

They can only go into STATE_STOPPED. I was a little concerned
that some of the rejoin code might inadvertently allow a stopping
MDS to end up active, but after a little auditing it looks like
that all behaves properly and this is an invariant we maintain.

Fixes: #10791

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
This commit is contained in:
Greg Farnum 2015-02-10 14:18:52 -08:00
parent 744f48e1cf
commit 9656018592

View File

@ -493,6 +493,14 @@ bool MDSMonitor::prepare_beacon(MMDSBeacon *m)
// state change
MDSMap::mds_info_t& info = pending_mdsmap.get_info_gid(gid);
if (info.state == MDSMap::STATE_STOPPING && state != MDSMap::STATE_STOPPED ) {
// we can't transition to any other states from STOPPING
dout(0) << "got beacon for MDS in STATE_STOPPING, ignoring requested state change"
<< dendl;
_note_beacon(m);
return true;
}
if (info.laggy()) {
dout(10) << "prepare_beacon clearing laggy flag on " << addr << dendl;
info.clear_laggy();