]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonClient: fix keepalive with v2 auth 26059/head
authorSage Weil <sage@redhat.com>
Thu, 7 Feb 2019 18:28:20 +0000 (12:28 -0600)
committerSage Weil <sage@redhat.com>
Thu, 7 Feb 2019 18:28:20 +0000 (12:28 -0600)
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 <sage@redhat.com>
src/mon/MonClient.cc
src/mon/MonClient.h

index 8b8faece8cf3b6bb934904880c4695be6515efb8..f26ef47ea65a1ae831df42ec7c2c4445c1fea768 100644 (file)
@@ -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;
 }
 
index 5503d46943d06f7c6f9ffa26ccc3072808fafac2..3b8faf58b59608186a3825c8dd28829a8717bdbf 100644 (file)
@@ -121,6 +121,7 @@ private:
   State state = State::NONE;
   ConnectionRef con;
   int auth_method = -1;
+  utime_t auth_start;
 
   std::unique_ptr<AuthClientHandler> auth;
   uint64_t global_id;