]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: automatically incorporate new incompat features into mdsmap
authorSage Weil <sage@newdream.net>
Thu, 5 Aug 2010 23:49:07 +0000 (16:49 -0700)
committerSage Weil <sage@newdream.net>
Thu, 5 Aug 2010 23:49:07 +0000 (16:49 -0700)
src/mon/MDSMonitor.cc

index 6ea28d2cdcf5cb3efde2844a4d0671a402089a12..549a5a523743172ba09f57546e326f1c4c8cd9da 100644 (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);