From: Sage Weil Date: Thu, 7 Feb 2019 18:28:20 +0000 (-0600) Subject: mon/MonClient: fix keepalive with v2 auth X-Git-Tag: v14.1.0~183^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F26059%2Fhead;p=ceph.git mon/MonClient: fix keepalive with v2 auth The old trick of queuing a keepalive sequenced before auth does not work when auth happens earlier in the process. Work around it. Signed-off-by: Sage Weil --- diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index 8b8faece8cf3..f26ef47ea65a 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -1475,6 +1475,8 @@ bool MonConnection::have_session() const void MonConnection::start(epoch_t epoch, const EntityName& entity_name) { + auth_start = ceph_clock_now(); + if (con->get_peer_addr().is_msgr2()) { ldout(cct, 10) << __func__ << " opening mon connection" << dendl; state = State::AUTHENTICATING; @@ -1594,6 +1596,7 @@ int MonConnection::handle_auth_done( if (auth_err >= 0) { state = State::HAVE_SESSION; } + con->set_last_keepalive_ack(auth_start); return auth_err; } diff --git a/src/mon/MonClient.h b/src/mon/MonClient.h index 5503d46943d0..3b8faf58b596 100644 --- a/src/mon/MonClient.h +++ b/src/mon/MonClient.h @@ -121,6 +121,7 @@ private: State state = State::NONE; ConnectionRef con; int auth_method = -1; + utime_t auth_start; std::unique_ptr auth; uint64_t global_id;