]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: ignore sync clients without required_features
authorSage Weil <sage@inktank.com>
Wed, 9 Apr 2014 21:40:44 +0000 (14:40 -0700)
committerSage Weil <sage@inktank.com>
Wed, 9 Apr 2014 21:40:44 +0000 (14:40 -0700)
If we let them sync data they don't understand they will get confused
and crash.

Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/Monitor.cc

index be0046beb9f49cd7279b36d0038f9e179cb69e81..0a1349a3fe6f040a860b099e20b03289b9d1c669 100644 (file)
@@ -1085,6 +1085,16 @@ void Monitor::handle_sync_get_cookie(MMonSync *m)
 
   assert(g_conf->mon_sync_provider_kill_at != 1);
 
+  // make sure they can understand us.
+  uint64_t required = apply_compatset_features_to_quorum_requirements();
+  if ((required ^ m->get_connection()->get_features()) & required) {
+    dout(5) << " ignoring peer mon." << m->get_source().num()
+           << " has features " << std::hex
+           << m->get_connection()->get_features()
+           << " but we require " << required << std::dec << dendl;
+    return;
+  }
+
   // make up a unique cookie.  include election epoch (which persists
   // across restarts for the whole cluster) and a counter for this
   // process instance.  there is no need to be unique *across*