From: Sage Weil Date: Wed, 9 Apr 2014 21:40:44 +0000 (-0700) Subject: mon: ignore sync clients without required_features X-Git-Tag: v0.80-rc1~69^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c8039ab857c66be02b920e343ccecc843de4afa1;p=ceph.git mon: ignore sync clients without required_features If we let them sync data they don't understand they will get confused and crash. Signed-off-by: Sage Weil --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index be0046beb9f4..0a1349a3fe6f 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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*