From 96560185925c311535d422fe97b87db73ef8edea Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Tue, 10 Feb 2015 14:18:52 -0800 Subject: [PATCH] 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 --- src/mon/MDSMonitor.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 7760634c8e7..6566a97570a 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -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();