From: Kefu Chai Date: Fri, 15 May 2015 14:50:36 +0000 (+0800) Subject: mon: always reply mdsbeacon X-Git-Tag: v9.0.2~41^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b3555e9c328633c9e1fbc27d652c004b30535e5b;p=ceph.git mon: always reply mdsbeacon the MDS (Beacon) is always expecting the reply for the mdsbeacon messages from the lead mon, and it uses the delay as a metric for the laggy-ness of the Beacon. when it comes to the MDSMonitor on a peon, it will remove the route session at seeing a reply (route message) from leader, so a reply to mdsbeacon will stop the peon from resending the mdsbeacon request to the leader. if the MDSMonitor re-forwards the unreplied requests after they are outdated, there are chances that the requests reflecting old and even wrong state of the MDSs mislead the lead monitor. for example, the MDSs which sent the outdated messages could be dead. Fixes: #11590 Signed-off-by: Kefu Chai --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 7dc6c92df8d2..524fcc9a80ce 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -320,7 +320,7 @@ bool MDSMonitor::preprocess_beacon(MMDSBeacon *m) goto out; } // is there a state change here? - if (info.state != state) { + if (info.state != state) { // legal state change? if ((info.state == MDSMap::STATE_STANDBY || info.state == MDSMap::STATE_STANDBY_REPLAY || @@ -639,8 +639,14 @@ void MDSMonitor::_updated(MMDSBeacon *m) if (m->get_state() == MDSMap::STATE_STOPPED) { // send the map manually (they're out of the map, so they won't get it automatic) mon->send_reply(m, new MMDSMap(mon->monmap->fsid, &mdsmap)); + } else { + mon->send_reply(m, new MMDSBeacon(mon->monmap->fsid, + m->get_global_id(), + m->get_name(), + mdsmap.get_epoch(), + m->get_state(), + m->get_seq())); } - m->put(); }