summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-11-23 14:45:00 -0800
committerSage Weil <sage@newdream.net>2009-11-24 19:02:05 -0800
commit1ac56b7d7a533714dba62d36e7f0897d0d068afe (patch)
treea4ab57674d02cf2192467de303cc577479ead75d
parente6e8f87891de7b8788142fee068db69e8d608006 (diff)
downloadceph-1ac56b7d7a533714dba62d36e7f0897d0d068afe.tar.gz
mon: avoid mds state update when clearing laggy flag
Do not clear laggy flag (or otherwise get into prepare_update) if the mds hasn't seen the latest map. Previously we could go to clear laggy and also revert to an old mds state.
-rw-r--r--src/mon/MDSMonitor.cc54
1 files changed, 25 insertions, 29 deletions
diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc
index 8e7008139ea..acc2151217a 100644
--- a/src/mon/MDSMonitor.cc
+++ b/src/mon/MDSMonitor.cc
@@ -179,42 +179,38 @@ bool MDSMonitor::preprocess_beacon(MMDSBeacon *m)
goto out;
}
- // can i handle this query without a map update?
+ if (mdsmap.get_epoch() != m->get_last_epoch_seen()) {
+ dout(10) << "mds_beacon " << *m
+ << " ignoring requested state, because mds hasn't seen latest map" << dendl;
+ goto ignore;
+ }
if (info.laggy()) {
return false; // no longer laggy, need to update map.
}
- else if (state == MDSMap::STATE_BOOT) {
+ if (state == MDSMap::STATE_BOOT) {
// ignore, already booted.
goto out;
}
- else {
- // is there a state change here?
- if (info.state != state) {
- if (mdsmap.get_epoch() != m->get_last_epoch_seen()) {
- dout(10) << "mds_beacon " << *m
- << " ignoring requested state, because mds hasn't seen latest map" << dendl;
- goto ignore;
- }
-
- // legal state change?
- if ((info.state == MDSMap::STATE_STANDBY ||
- info.state == MDSMap::STATE_STANDBY_REPLAY) && state > 0) {
- dout(10) << "mds_beacon mds can't activate itself (" << ceph_mds_state_name(info.state)
- << " -> " << ceph_mds_state_name(state) << ")" << dendl;
- goto ignore;
- }
-
- if (info.state == MDSMap::STATE_STANDBY &&
- state == MDSMap::STATE_STANDBY_REPLAY &&
- (pending_mdsmap.is_degraded() ||
- pending_mdsmap.get_state(info.rank) < MDSMap::STATE_ACTIVE)) {
- dout(10) << "mds_beacon can't standby-replay mds" << info.rank << " at this time (cluster degraded, or mds not active)" << dendl;
- goto ignore;
- }
-
- return false; // need to update map
+ // is there a state change here?
+ if (info.state != state) {
+ // legal state change?
+ if ((info.state == MDSMap::STATE_STANDBY ||
+ info.state == MDSMap::STATE_STANDBY_REPLAY) && state > 0) {
+ dout(10) << "mds_beacon mds can't activate itself (" << ceph_mds_state_name(info.state)
+ << " -> " << ceph_mds_state_name(state) << ")" << dendl;
+ goto ignore;
}
+
+ if (info.state == MDSMap::STATE_STANDBY &&
+ state == MDSMap::STATE_STANDBY_REPLAY &&
+ (pending_mdsmap.is_degraded() ||
+ pending_mdsmap.get_state(info.rank) < MDSMap::STATE_ACTIVE)) {
+ dout(10) << "mds_beacon can't standby-replay mds" << info.rank << " at this time (cluster degraded, or mds not active)" << dendl;
+ goto ignore;
+ }
+
+ return false; // need to update map
}
ignore:
@@ -299,7 +295,7 @@ bool MDSMonitor::prepare_beacon(MMDSBeacon *m)
MDSMap::mds_info_t& info = pending_mdsmap.get_info_gid(gid);
if (info.laggy()) {
- dout(10) << "prepare_beacon clearly laggy flag on " << addr << dendl;
+ dout(10) << "prepare_beacon clearing laggy flag on " << addr << dendl;
info.clear_laggy();
}