From: Sage Weil Date: Thu, 5 Aug 2010 23:49:07 +0000 (-0700) Subject: mon: automatically incorporate new incompat features into mdsmap X-Git-Tag: v0.22~308^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d97e42e1aaaee4b09496889116b86ff1325e0bf0;p=ceph.git mon: automatically incorporate new incompat features into mdsmap --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 6ea28d2cdcf..549a5a52374 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -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);