Skip to content

Commit

Permalink
mon: always reply mdsbeacon
Browse files Browse the repository at this point in the history
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 <kchai@redhat.com>
(cherry picked from commit b3555e9)
  • Loading branch information
tchaikov authored and theanalyst committed Jul 1, 2015
1 parent 413e407 commit 524f4a5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/mon/MDSMonitor.cc
Expand Up @@ -318,7 +318,7 @@ bool MDSMonitor::preprocess_beacon(MMDSBeacon *m)
goto ignore;
}
// 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 ||
Expand Down Expand Up @@ -592,8 +592,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();
}

Expand Down

0 comments on commit 524f4a5

Please sign in to comment.