]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg: indicate ms_handle_authentication is fast
authorPatrick Donnelly <pdonnell@redhat.com>
Mon, 10 Jul 2023 20:56:43 +0000 (16:56 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 28 Aug 2023 13:50:19 +0000 (09:50 -0400)
Like other fast Dispatcher methods, it must not acquire locks or do
anything that might take a long time.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 3e2075103a0ab6b7ced5800db1d44d13b1c8b7e6)

15 files changed:
src/mds/MDSDaemon.cc
src/mds/MDSDaemon.h
src/mgr/DaemonServer.cc
src/mgr/DaemonServer.h
src/mon/AuthMonitor.cc
src/mon/MonClient.cc
src/mon/Monitor.cc
src/mon/Monitor.h
src/msg/Dispatcher.h
src/osd/OSD.cc
src/osd/OSD.h
src/test/fio/fio_ceph_messenger.cc
src/test/msgr/perf_msgr_client.cc
src/test/msgr/perf_msgr_server.cc
src/test/msgr/test_msgr.cc

index de8f8838f9d59a6d6b0e107f9ba81bcc93e60003..009c6c31e794a978086c933ebd644db81d4df5f2 100644 (file)
@@ -1070,7 +1070,7 @@ bool MDSDaemon::parse_caps(const AuthCapsInfo& info, MDSAuthCaps& caps)
   }
 }
 
-int MDSDaemon::ms_handle_authentication(Connection *con)
+int MDSDaemon::ms_handle_fast_authentication(Connection *con)
 {
   /* N.B. without mds_lock! */
   MDSAuthCaps caps;
index 97162cc88559cca87cefbb58f20ea0f5520b700e..35a9330f1b59145b39176139d8325568502e56cf 100644 (file)
@@ -146,7 +146,7 @@ class MDSDaemon : public Dispatcher {
 
  private:
   bool ms_dispatch2(const ref_t<Message> &m) override;
-  int ms_handle_authentication(Connection *con) override;
+  int ms_handle_fast_authentication(Connection *con) override;
   void ms_handle_accept(Connection *con) override;
   void ms_handle_connect(Connection *con) override;
   bool ms_handle_reset(Connection *con) override;
index 15cd9f0e7e02e0b3e46555b2a57b5ece2a80c118..b1c1213e03ad5b8e8ef5a64c2640c66037c8f20e 100644 (file)
@@ -171,7 +171,7 @@ entity_addrvec_t DaemonServer::get_myaddrs() const
   return msgr->get_myaddrs();
 }
 
-int DaemonServer::ms_handle_authentication(Connection *con)
+int DaemonServer::ms_handle_fast_authentication(Connection *con)
 {
   auto s = ceph::make_ref<MgrSession>(cct);
   con->set_priv(s);
index a4cf990bd319bbca78de8d38bf7455629827e292..eaaac41b71cdafb13f07cd01e84bd13ed3d02acc 100644 (file)
@@ -269,7 +269,7 @@ public:
   ~DaemonServer() override;
 
   bool ms_dispatch2(const ceph::ref_t<Message>& m) override;
-  int ms_handle_authentication(Connection *con) override;
+  int ms_handle_fast_authentication(Connection *con) override;
   bool ms_handle_reset(Connection *con) override;
   void ms_handle_remote_reset(Connection *con) override {}
   bool ms_handle_refused(Connection *con) override;
index f08608c6133d6e44d2306792587dd10d2aa37fdd..9931caa580002d5b992f8b73572d4cc80ab9a0e8 100644 (file)
@@ -773,7 +773,7 @@ bool AuthMonitor::prep_auth(MonOpRequestRef op, bool paxos_writable)
     }
     if (ret > 0) {
       if (!s->authenticated &&
-         mon.ms_handle_authentication(s->con.get()) > 0) {
+         mon.ms_handle_fast_authentication(s->con.get()) > 0) {
        finished = true;
       }
       ret = 0;
index a9fba82883b9ef63facdc68d47e2405ddd56b68e..357a1a2764c641cfde94cbedfeaa8b7980c2dc97 100644 (file)
@@ -1570,7 +1570,7 @@ int MonClient::handle_auth_request(
     // for some channels prior to nautilus (osd heartbeat), we
     // tolerate the lack of an authorizer.
     if (!con->get_messenger()->require_authorizer) {
-      handle_authentication_dispatcher->ms_handle_authentication(con);
+      handle_authentication_dispatcher->ms_handle_fast_authentication(con);
       return 1;
     }
     return -EACCES;
@@ -1608,7 +1608,7 @@ int MonClient::handle_auth_request(
     &auth_meta->connection_secret,
     ac);
   if (isvalid) {
-    handle_authentication_dispatcher->ms_handle_authentication(con);
+    handle_authentication_dispatcher->ms_handle_fast_authentication(con);
     return 1;
   }
   if (!more && !was_challenge && auth_meta->authorizer_challenge) {
index 26ea7acd2f59a3e4418a40ddc4412d06f5657572..ffc99ec24b7c0bed283c7f794ed553f8ecd65201 100644 (file)
@@ -6352,7 +6352,7 @@ int Monitor::handle_auth_request(
       &auth_meta->connection_secret,
       &auth_meta->authorizer_challenge);
     if (isvalid) {
-      ms_handle_authentication(con);
+      ms_handle_fast_authentication(con);
       return 1;
     }
     if (!more && !was_challenge && auth_meta->authorizer_challenge) {
@@ -6473,7 +6473,7 @@ int Monitor::handle_auth_request(
   }
   if (r > 0 &&
       !s->authenticated) {
-    ms_handle_authentication(con);
+    ms_handle_fast_authentication(con);
   }
 
   dout(30) << " r " << r << " reply:\n";
@@ -6511,7 +6511,7 @@ void Monitor::ms_handle_accept(Connection *con)
   }
 }
 
-int Monitor::ms_handle_authentication(Connection *con)
+int Monitor::ms_handle_fast_authentication(Connection *con)
 {
   if (con->get_peer_type() == CEPH_ENTITY_TYPE_MON) {
     // mon <-> mon connections need no Session, and setting one up
index 1093649bb3df2ad34631935b003a0dfb1c270fe7..e52fb974d5b62c4a2ec685fbe7d8dd40a485d70b 100644 (file)
@@ -957,7 +957,7 @@ public:
   MonCap mon_caps;
   bool get_authorizer(int dest_type, AuthAuthorizer **authorizer);
 public: // for AuthMonitor msgr1:
-  int ms_handle_authentication(Connection *con) override;
+  int ms_handle_fast_authentication(Connection *con) override;
 private:
   void ms_handle_accept(Connection *con) override;
   bool ms_handle_reset(Connection *con) override;
index 5e025437b53570ad78844cb38e7e6c3c6bfeab74..885f1843b31c417c35f766fbecbb390f4ef0510c 100644 (file)
@@ -204,13 +204,16 @@ public:
   /**
    * handle successful authentication (msgr2)
    *
-   * Authenticated result/state will be attached to the Connection.
+   * Authenticated result/state will be attached to the Connection. This is
+   * called via the MonClient.
+   *
+   * Do not acquire locks in this method! It is considered "fast" delivery.
    *
    * return 1 for success
    * return 0 for no action (let another Dispatcher handle it)
    * return <0 for failure (failure to parse caps, for instance)
    */
-  virtual int ms_handle_authentication(Connection *con) {
+  virtual int ms_handle_fast_authentication(Connection *con) {
     return 0;
   }
 
index c8f87a18bd5c47c110d741fd3b27c396f70ee051..e0d8d78650a1fdb4cc2a06c5bb0ee1e25692a106 100644 (file)
@@ -7338,7 +7338,7 @@ void OSD::ms_fast_dispatch(Message *m)
   OID_EVENT_TRACE_WITH_MSG(m, "MS_FAST_DISPATCH_END", false);
 }
 
-int OSD::ms_handle_authentication(Connection *con)
+int OSD::ms_handle_fast_authentication(Connection *con)
 {
   int ret = 0;
   auto s = ceph::ref_cast<Session>(con->get_priv());
index 9efb2b62cba708f232ae2e11298e9d7cb1879e1a..0e9bc06a3b79d21d079fff4b60e02ab9277c5a21 100644 (file)
@@ -1572,7 +1572,7 @@ public:
     bool ms_handle_refused(Connection *con) override {
       return osd->ms_handle_refused(con);
     }
-    int ms_handle_authentication(Connection *con) override {
+    int ms_handle_fast_authentication(Connection *con) override {
       return true;
     }
   } heartbeat_dispatcher;
@@ -2033,7 +2033,7 @@ private:
   void ms_handle_connect(Connection *con) override;
   void ms_handle_fast_connect(Connection *con) override;
   void ms_handle_fast_accept(Connection *con) override;
-  int ms_handle_authentication(Connection *con) override;
+  int ms_handle_fast_authentication(Connection *con) override;
   bool ms_handle_reset(Connection *con) override;
   void ms_handle_remote_reset(Connection *con) override {}
   bool ms_handle_refused(Connection *con) override;
index 4a4cf4fb575125d88dba96815095d93e7f68500f..e5e170288ffe25c21b9eaa2bf86c861624038c4d 100644 (file)
@@ -268,7 +268,7 @@ public:
   bool ms_handle_refused(Connection *con) override {
     return false;
   }
-  int ms_handle_authentication(Connection *con) override {
+  int ms_handle_fast_authentication(Connection *con) override {
     return 1;
   }
 };
index 0e5c5ab367f29353c95f4019da3319b3262b8fb5..32fa4002f5fe47a77de644c1a04b1c8c50a06c9d 100644 (file)
@@ -57,7 +57,7 @@ class MessengerClient {
     bool ms_handle_reset(Connection *con) override { return true; }
     void ms_handle_remote_reset(Connection *con) override {}
     bool ms_handle_refused(Connection *con) override { return false; }
-    int ms_handle_authentication(Connection *con) override {
+    int ms_handle_fast_authentication(Connection *con) override {
       return 1;
     }
   };
index f17f90f6d081a6c1c0086c2e4728a249509eefa2..67bb591a9031898d9e0e7e8247de2aed7fe037e2 100644 (file)
@@ -100,7 +100,7 @@ class ServerDispatcher : public Dispatcher {
     //cerr << __func__ << " reply message=" << m << std::endl;
     op_wq.queue(m);
   }
-  int ms_handle_authentication(Connection *con) override {
+  int ms_handle_fast_authentication(Connection *con) override {
     return 1;
   }
 };
index 3ebe320be1191274eb6cb7de849204d479efbf82..8e4506a4ef08739ed0ca4725245358ebb28ab6ec 100644 (file)
@@ -215,7 +215,7 @@ class FakeDispatcher : public Dispatcher {
     cond.notify_all();
   }
 
-  int ms_handle_authentication(Connection *con) override {
+  int ms_handle_fast_authentication(Connection *con) override {
     return 1;
   }
 
@@ -1704,7 +1704,7 @@ class SyntheticDispatcher : public Dispatcher {
     }
   }
 
-  int ms_handle_authentication(Connection *con) override {
+  int ms_handle_fast_authentication(Connection *con) override {
     return 1;
   }
 
@@ -2262,7 +2262,7 @@ class MarkdownDispatcher : public Dispatcher {
   void ms_fast_dispatch(Message *m) override {
     ceph_abort();
   }
-  int ms_handle_authentication(Connection *con) override {
+  int ms_handle_fast_authentication(Connection *con) override {
     return 1;
   }
 };