]> 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, 10 Jul 2023 21:12:11 +0000 (17:12 -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>
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 79a2b58a9ac757b898772d5ec1d7b9a9eefca99a..49679d7ff9b3d00a543141f8fb1fb7da4fb2e63c 100644 (file)
@@ -1089,7 +1089,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 1fe872ba9675b4b2ce3709e2c0e0e1e8308f0651..e7929d2c37deccd23ffa3fa271ae85cd62082937 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 83253d25bd032dc2db9adf4bbe2c0baf0aeaa9c2..f2a4fb8fb51abdfd51d82da630828de7a64af45a 100644 (file)
@@ -179,7 +179,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 ff98356807ad976c03ca28d3a0f5927bad83b423..40b7d2a813755d9e492b27f6a238eee3edede30d 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 8cb6789394b36dd08cc8aa99f250f14f47cbeb1f..d8adc22b732c5c26811dfae7196ba6211b434b5b 100644 (file)
@@ -827,7 +827,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 45550a5ca77d72a4e8f5fc09e365c3fdc76b37c6..2359cdf6c2888aa80996940c0abbccd7206fddf5 100644 (file)
@@ -1605,7 +1605,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;
@@ -1643,7 +1643,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 1f6359c83a14243ae51d033fc0db2fd4cc3b6671..2fed735f9a20c8ac48d32e16fa6e06dcc44c9899 100644 (file)
@@ -6377,7 +6377,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) {
@@ -6498,7 +6498,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";
@@ -6536,7 +6536,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 998fe91eb603566f2a936e25cc78c85495cf34d2..7f9a16a9a36c8709fd339ac1b1d24929c49f0e33 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 e9d4b1c886a094dca1a348a7f9dec088c7572b2b..d85f20fb4fab3f1ea7b7df52fc7ee4093dffa290 100644 (file)
@@ -7514,7 +7514,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 43e9ee7abf698c78fb9946f42ff3a6b8f2d65323..fc40c93a52e36d8f1765985a9a141e6a8316570b 100644 (file)
@@ -1526,7 +1526,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;
@@ -1949,7 +1949,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 2e18c7c633035a3e3efd8102bf2eb3a24a1afd36..81680f102dd13cc10e4c701c21086757bec1f0c4 100644 (file)
@@ -271,7 +271,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 20fff879bfdcdaf646f774bc4f6546f5a2cc8cb2..ffbfc1614fe737e0f5a3034664cfa07880538334 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 aec5923fcbfea36865355181580b97f6ecf09a2b..0c492ab174b7bfe2a0c707050090476a0d893fc5 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 fd7b30fdc7f98b1e6145be630f7d603a602a4dba..f702cc288caedd5ab5e1c3750bca67d5b06c80f4 100644 (file)
@@ -220,7 +220,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;
   }
 
@@ -1709,7 +1709,7 @@ class SyntheticDispatcher : public Dispatcher {
     }
   }
 
-  int ms_handle_authentication(Connection *con) override {
+  int ms_handle_fast_authentication(Connection *con) override {
     return 1;
   }
 
@@ -2322,7 +2322,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;
   }
 };