]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
MDSMonitor: do not allow MDS to transition from STATE_STOPPING 3683/head
authorGreg Farnum <gfarnum@redhat.com>
Tue, 10 Feb 2015 22:18:52 +0000 (14:18 -0800)
committerGreg Farnum <gfarnum@redhat.com>
Tue, 10 Feb 2015 22:18:52 +0000 (14:18 -0800)
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>
src/mon/MDSMonitor.cc

index 7760634c8e72cc31f001fb2276726a8809204c5d..6566a97570a142f6d973b62a9e287707142cb820 100644 (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();