]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonClient: disable ms_bind_msgr2 if NAUTILUS feature not set
authorSage Weil <sage@redhat.com>
Fri, 21 Dec 2018 14:57:22 +0000 (08:57 -0600)
committerSage Weil <sage@redhat.com>
Thu, 3 Jan 2019 17:17:31 +0000 (11:17 -0600)
Do not try to bind to v2 addresses until all of the mons will know what
we are doing and will be able to advertise those addresses.

This avoids the possibility of corner cases where we bind to one thing
but advertise something different via the various cluster maps.

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

index a4948f84a72498ba04d1c01cfa7a6987d42f4b4b..a273d6abe103f0d08fb1eec7472ee71b024d1092 100644 (file)
@@ -363,6 +363,15 @@ void MonClient::handle_monmap(MMonMap *m)
   monmap.print(*_dout);
   *_dout << dendl;
 
+  if (monmap.get_epoch() > 0 &&
+      !monmap.get_required_features().contains_all(
+       ceph::features::mon::FEATURE_NAUTILUS) &&
+      cct->_conf.get_val<bool>("ms_bind_msgr2")) {
+    ldout(cct,1) << " disabling ms_bind_msgr2 because monmap does not have"
+                << " NAUTILUS feature set" << dendl;
+    cct->_conf.set_val("ms_bind_msgr2", "false");
+  }
+
   if (old_name.size() == 0) {
     ldout(cct,10) << " can't identify which mon we were connected to" << dendl;
     _reopen_session();