mon: automatically incorporate new incompat features into mdsmap

This commit is contained in:
Sage Weil 2010-08-05 16:49:07 -07:00
parent 846e979cbb
commit d97e42e1aa

View File

@ -175,8 +175,15 @@ bool MDSMonitor::preprocess_beacon(MMDSBeacon *m)
dout(12) << "preprocess_beacon " << *m
<< " from " << m->get_orig_source_inst()
<< " " << m->get_compat()
<< dendl;
// check compat
if (!m->get_compat().writeable(mdsmap.compat)) {
dout(1) << " mds " << m->get_source_inst() << " can't write to mdsmap " << mdsmap.compat << dendl;
goto out;
}
// fw to leader?
if (!mon->is_leader())
return false;
@ -326,6 +333,14 @@ bool MDSMonitor::prepare_beacon(MMDSBeacon *m)
last_beacon[gid].stamp = g_clock.now();
last_beacon[gid].seq = seq;
// new incompat?
if (!pending_mdsmap.compat.writeable(m->get_compat())) {
dout(10) << " mdsmap " << pending_mdsmap.compat << " can't write to new mds' " << m->get_compat()
<< ", updating mdsmap and killing old mds's"
<< dendl;
pending_mdsmap.compat = m->get_compat();
}
} else {
// state change
MDSMap::mds_info_t& info = pending_mdsmap.get_info_gid(gid);