From 24f0d25fe4948648c130cffcfe99a646380a1778 Mon Sep 17 00:00:00 2001 From: sageweil Date: Mon, 10 Sep 2007 03:34:46 +0000 Subject: [PATCH] go straight to standby, do not pass creating or starting git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1806 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/mon/MDSMonitor.cc | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/trunk/ceph/mon/MDSMonitor.cc b/trunk/ceph/mon/MDSMonitor.cc index e8afa3bdd7007..5064f204b73bd 100644 --- a/trunk/ceph/mon/MDSMonitor.cc +++ b/trunk/ceph/mon/MDSMonitor.cc @@ -315,6 +315,14 @@ bool MDSMonitor::handle_beacon(MMDSBeacon *m) // reset the beacon timer last_beacon[from] = g_clock.now(); + + // if starting|creating and degraded|full, go to standby + if ((state == MDSMap::STATE_CREATING || state == MDSMap::STATE_STARTING) && + (pending_mdsmap.would_be_overfull_with(from) || + pending_mdsmap.is_degraded())) { + dout(10) << "mds_beacon cluster full, mds" << from << " will be standby" << dendl; + state = MDSMap::STATE_STANDBY; + } } // created? @@ -324,17 +332,6 @@ bool MDSMonitor::handle_beacon(MMDSBeacon *m) dout(10) << "mds_beacon created mds" << from << dendl; } - // if starting|creating and degraded|full, go to standby - if ((state == MDSMap::STATE_STARTING || - state == MDSMap::STATE_CREATING || - mdsmap.is_starting(from) || - mdsmap.is_creating(from)) && - (pending_mdsmap.is_degraded() || - pending_mdsmap.is_full())) { - dout(10) << "mds_beacon cluster degraded|full, mds" << from << " will be standby" << dendl; - state = MDSMap::STATE_STANDBY; - } - // update the map dout(10) << "mds_beacon mds" << from << " " << MDSMap::get_state_name(mdsmap.mds_state[from]) << " -> " << MDSMap::get_state_name(state) -- 2.39.5