const char *monhost = 0;
int whoami = -1;
bool standby = false; // by default, i'll start active.
+ int standby_replay_for;
for (unsigned i=0; i<args.size(); i++) {
if (strcmp(args[i], "--standby") == 0)
standby = true;
else if (strcmp(args[i], "--mds") == 0)
whoami = atoi(args[++i]);
+ else if (strcmp(args[i], "--standby_replay_for") == 0)
+ whoami = standby_replay_for = atoi(args[++i]);
else if (monhost == 0)
monhost = args[i];
else {
// start mds
MDS *mds = new MDS(whoami, m, &monmap);
+ mds->standby_replay_for = standby_replay_for;
mds->init(standby);
rank.wait();
mds_lock("MDS::mds_lock"),
timer(mds_lock),
whoami(whoami_), incarnation(0),
+ standby_replay_for(-1),
messenger(m),
monmap(mm),
logclient(messenger, monmap),
if (state == MDSMap::STATE_STANDBY) {
want_state = state = MDSMap::STATE_STANDBY;
dout(1) << "handle_mds_map standby" << dendl;
+
+ if (standby_replay_for >= 0)
+ request_state(MDSMap::STATE_STANDBY_REPLAY);
+
goto out;
}
+
// ??
assert(whoami >= 0);
incarnation = mdsmap->get_inc(whoami);
<< " -> " << MDSMap::get_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.mds) < MDSMap::STATE_ACTIVE)) {
+ dout(10) << "mds_beacon can't standby-replay mds" << info.mds << " at this time (cluster degraded, or mds not active)" << dendl;
+ goto ignore;
+ }
return false; // need to update map
}
// and is there a non-laggy standby that can take over for us?
entity_addr_t sa;
if (info.mds >= 0 &&
- (info.state > 0 || info.state == MDSMap::STATE_STANDBY_REPLAY) &&
+ info.state > 0 && //|| info.state == MDSMap::STATE_STANDBY_REPLAY) &&
pending_mdsmap.find_standby_for(info.mds, sa)) {
dout(10) << " replacing " << addr << " mds" << info.mds << "." << info.inc
<< " " << MDSMap::get_state_name(info.state)
mon->osdmon()->propose_pending();
}
+ do_propose = true;
+ } else if (info.state == MDSMap::STATE_STANDBY_REPLAY) {
+ dout(10) << " failing " << addr << " mds" << info.mds << "." << info.inc
+ << " " << MDSMap::get_state_name(info.state)
+ << dendl;
+ pending_mdsmap.mds_info.erase(addr);
do_propose = true;
} else if (!info.laggy()) {
// just mark laggy
}
// have a standby replay/shadow an active mds?
- if (!pending_mdsmap.is_degraded() &&
+ if (false &&
+ !pending_mdsmap.is_degraded() &&
pending_mdsmap.get_num_mds(MDSMap::STATE_STANDBY) >= pending_mdsmap.get_num_mds()) {
// see which nodes are shadowed
set<int> shadowed;
case MDSMap::STATE_RESOLVE:
case MDSMap::STATE_RECONNECT:
case MDSMap::STATE_REJOIN:
- // BUG: hrm, if this is the case, the STOPPING gusy won't be able to stop, will they?
+ // BUG: hrm, if this is the case, the STOPPING guys won't be able to stop, will they?
pending_mdsmap.failed.insert(info.mds);
pending_mdsmap.up.erase(info.mds);
pending_mdsmap.mds_info.erase(info.addr);