]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/Dispatcher: remove force_new arg from ms_get_authorizer() 25998/head
authorSage Weil <sage@redhat.com>
Wed, 16 Jan 2019 21:45:32 +0000 (15:45 -0600)
committerSage Weil <sage@redhat.com>
Thu, 17 Jan 2019 12:33:32 +0000 (06:33 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
29 files changed:
src/client/Client.cc
src/client/Client.h
src/crimson/net/Dispatcher.cc
src/crimson/net/Dispatcher.h
src/crimson/net/SocketConnection.cc
src/librados/RadosClient.cc
src/librados/RadosClient.h
src/mds/MDSDaemon.cc
src/mds/MDSDaemon.h
src/mgr/DaemonServer.cc
src/mgr/DaemonServer.h
src/mgr/MgrStandby.cc
src/mgr/MgrStandby.h
src/mon/Monitor.cc
src/mon/Monitor.h
src/msg/Dispatcher.h
src/msg/Messenger.h
src/msg/async/ProtocolV1.cc
src/msg/async/ProtocolV2.cc
src/msg/simple/Pipe.cc
src/osd/OSD.cc
src/osd/OSD.h
src/osdc/Objecter.cc
src/osdc/Objecter.h
src/test/crimson/test_alien_echo.cc
src/test/messenger/simple_dispatcher.h
src/test/messenger/xio_dispatcher.h
src/tools/cephfs/MDSUtility.cc
src/tools/cephfs/MDSUtility.h

index 0536ba1aed8025a29e86c72b8370bea945e2330b..a0b54d3dc10d7505e6e529944c91ab2762e344af 100644 (file)
@@ -13936,7 +13936,7 @@ bool Client::ms_handle_refused(Connection *con)
   return false;
 }
 
-bool Client::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new)
+bool Client::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer)
 {
   if (dest_type == CEPH_ENTITY_TYPE_MON)
     return true;
index 6c4b8b3876a9cde94f6d0721b905f40af88f3b5e..9b46ad3a5ba6ef86afbe22a822e1e4addc2b91c4 100644 (file)
@@ -924,7 +924,7 @@ protected:
   bool ms_handle_reset(Connection *con) override;
   void ms_handle_remote_reset(Connection *con) override;
   bool ms_handle_refused(Connection *con) override;
-  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new) override;
+  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer) override;
 
   int authenticate();
 
index e47290a7025f17e3de812643e8a0927a582dbd3d..336ded38f0f182e35e45a8c5ff26a99f7707245b 100644 (file)
@@ -4,7 +4,7 @@
 namespace ceph::net
 {
 seastar::future<std::unique_ptr<AuthAuthorizer>>
-Dispatcher::ms_get_authorizer(peer_type_t, bool force_new)
+Dispatcher::ms_get_authorizer(peer_type_t)
 {
   return seastar::make_ready_future<std::unique_ptr<AuthAuthorizer>>(nullptr);
 }
index f90429cd12fb2fc6ce964715ed1f84b6576646f6..94d6613e269ae404936b2bbb0e4ae0cf993ecee6 100644 (file)
@@ -53,7 +53,7 @@ class Dispatcher {
     return seastar::make_ready_future<msgr_tag_t, bufferlist>(0, bufferlist{});
   }
   virtual seastar::future<std::unique_ptr<AuthAuthorizer>>
-  ms_get_authorizer(peer_type_t, bool force_new);
+  ms_get_authorizer(peer_type_t);
 };
 
 } // namespace ceph::net
index 587fc39785704023d008ea7d9ce44ead16f6ab98..766a885bb34b87f5b8d214b6c30f4a8227f5917c 100644 (file)
@@ -737,7 +737,7 @@ SocketConnection::repeat_connect()
   // this is fyi, actually, server decides!
   h.connect.flags = policy.lossy ? CEPH_MSG_CONNECT_LOSSY : 0;
 
-  return dispatcher.ms_get_authorizer(peer_type, false)
+  return dispatcher.ms_get_authorizer(peer_type)
     .then([this](auto&& auth) {
       h.authorizer = std::move(auth);
       bufferlist bl;
index 4adc3755cf03389bdf69180deaab7b767a54d12b..446482e1af231df7bbeec03e3394e78a49414fa0 100644 (file)
@@ -57,8 +57,7 @@
 #define dout_prefix *_dout << "librados: "
 
 bool librados::RadosClient::ms_get_authorizer(int dest_type,
-                                             AuthAuthorizer **authorizer,
-                                             bool force_new) {
+                                             AuthAuthorizer **authorizer) {
   //ldout(cct, 0) << "RadosClient::ms_get_authorizer type=" << dest_type << dendl;
   /* monitor authorization is being handled on different layer */
   if (dest_type == CEPH_ENTITY_TYPE_MON)
index cc0cc0029347531519b1bf95ab331e8cbf212ed5..8c12aa066a12529e47d65295615aaa6f673909e2 100644 (file)
@@ -61,7 +61,7 @@ private:
   bool _dispatch(Message *m);
   bool ms_dispatch(Message *m) override;
 
-  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new) override;
+  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer) override;
   void ms_handle_connect(Connection *con) override;
   bool ms_handle_reset(Connection *con) override;
   void ms_handle_remote_reset(Connection *con) override;
index 0a532b6c4fa92b732814e54d631e0249775fbc18..7aadfd43aff2d6e3e44f1bc53e7714ea2e7f8ff4 100644 (file)
@@ -1169,7 +1169,7 @@ bool MDSDaemon::ms_dispatch2(const Message::ref &m)
   }
 }
 
-bool MDSDaemon::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new)
+bool MDSDaemon::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer)
 {
   dout(10) << "MDSDaemon::ms_get_authorizer type="
            << ceph_entity_type_name(dest_type) << dendl;
@@ -1178,12 +1178,6 @@ bool MDSDaemon::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bo
   if (dest_type == CEPH_ENTITY_TYPE_MON)
     return true;
 
-  if (force_new) {
-    auto timeout = g_conf().get_val<int64_t>("rotating_keys_renewal_timeout");
-    if (monc->wait_auth_rotating(timeout) < 0)
-      return false;
-  }
-
   *authorizer = monc->build_authorizer(dest_type);
   return *authorizer != NULL;
 }
index 366ef26dd9f5afdee93da41d595f95c7150ce429..130f1044ccf15496aef1b9f973639df61bb62f26 100644 (file)
@@ -110,7 +110,7 @@ class MDSDaemon : public Dispatcher, public md_config_obs_t {
 
  private:
   bool ms_dispatch2(const Message::ref &m) override;
-  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new) override;
+  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer) override;
   int ms_handle_authentication(Connection *con) override;
   KeyStore *ms_get_auth1_authorizer_keystore() override;
   void ms_handle_accept(Connection *con) override;
index e240e98fa7b82ba087d3373a58fa8c36a09d9c25..d9636ff914ce86bba86c5784c279557b92a20c4c 100644 (file)
@@ -217,8 +217,9 @@ int DaemonServer::ms_handle_authentication(Connection *con)
   return ret;
 }
 
-bool DaemonServer::ms_get_authorizer(int dest_type,
-    AuthAuthorizer **authorizer, bool force_new)
+bool DaemonServer::ms_get_authorizer(
+  int dest_type,
+  AuthAuthorizer **authorizer)
 {
   dout(10) << "type=" << ceph_entity_type_name(dest_type) << dendl;
 
@@ -226,12 +227,6 @@ bool DaemonServer::ms_get_authorizer(int dest_type,
     return true;
   }
 
-  if (force_new) {
-    auto timeout = g_conf().get_val<int64_t>("rotating_keys_renewal_timeout");
-    if (monc->wait_auth_rotating(timeout) < 0)
-      return false;
-  }
-
   *authorizer = monc->build_authorizer(dest_type);
   dout(20) << "got authorizer " << *authorizer << dendl;
   return *authorizer != NULL;
index d6a5aafbd6b97b1202602b1c081acc9bace69c28..35901aad4466fb84a13e5a0c0330e9ed51b43f26 100644 (file)
@@ -149,8 +149,7 @@ public:
   bool ms_handle_reset(Connection *con) override;
   void ms_handle_remote_reset(Connection *con) override {}
   bool ms_handle_refused(Connection *con) override;
-  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer,
-                         bool force_new) override;
+  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer) override;
   KeyStore *ms_get_auth1_authorizer_keystore() override;
 
   bool handle_open(MMgrOpen *m);
index 466a703787a6559676ceea67800ba73d44d013a6..04cac5428268ebf3607d58173c2fd0178ee0eb0d 100644 (file)
@@ -429,18 +429,11 @@ bool MgrStandby::ms_dispatch(Message *m)
 }
 
 
-bool MgrStandby::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer,
-                         bool force_new)
+bool MgrStandby::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer)
 {
   if (dest_type == CEPH_ENTITY_TYPE_MON)
     return true;
 
-  if (force_new) {
-    auto timeout = cct->_conf.get_val<int64_t>("rotating_keys_renewal_timeout");
-    if (monc.wait_auth_rotating(timeout) < 0)
-      return false;
-  }
-
   *authorizer = monc.build_authorizer(dest_type);
   return *authorizer != NULL;
 }
index 9b1071117ee6fe1e461589c3c252a52f3e8794fa..cdbd572e2ecacac204a42164a79e0aaeee822587 100644 (file)
@@ -73,8 +73,7 @@ public:
   bool ms_dispatch(Message *m) override;
   bool ms_handle_reset(Connection *con) override { return false; }
   void ms_handle_remote_reset(Connection *con) override {}
-  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer,
-                         bool force_new) override;
+  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer) override;
   bool ms_handle_refused(Connection *con) override;
 
   int init();
index e3dcd96b1bce99ee5c4cd0ea46d445832ddb8f99..c4a8f77d78e0c619f40edb7daf8e0565896b8699 100644 (file)
@@ -5799,8 +5799,7 @@ void Monitor::extract_save_mon_key(KeyRing& keyring)
   }
 }
 
-bool Monitor::ms_get_authorizer(int service_id, AuthAuthorizer **authorizer,
-                               bool force_new)
+bool Monitor::ms_get_authorizer(int service_id, AuthAuthorizer **authorizer)
 {
   dout(10) << "ms_get_authorizer for " << ceph_entity_type_name(service_id)
           << dendl;
index f6ba723125830f85531b81568b6060cdef9df887..018a41110c8ae368b734e47af814b27b06238559 100644 (file)
@@ -888,7 +888,7 @@ public:
   void dispatch_op(MonOpRequestRef op);
   //mon_caps is used for un-connected messages from monitors
   MonCap mon_caps;
-  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new) override;
+  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer) override;
   KeyStore *ms_get_auth1_authorizer_keystore();
 public: // for AuthMonitor msgr1:
   int ms_handle_authentication(Connection *con) override;
index 9ddf95bd56c37dc47133389b26d89253b2d076c3..fbfa80e86a49a7c00e652a9c3dcaa38aaabc8849 100644 (file)
@@ -238,7 +238,9 @@ public:
    *
    * @return True if this function call properly filled in *a, false otherwise.
    */
-  virtual bool ms_get_authorizer(int dest_type, AuthAuthorizer **a, bool force_new) { return false; }
+  virtual bool ms_get_authorizer(int dest_type, AuthAuthorizer **a) {
+    return false;
+  }
   /**
    * @} //Authentication
    */
index 07e536a83802ea0d0b6f173a902239cf17261a23..04a7686c868d917d2963bc66ef1efb935df7bbfb 100644 (file)
@@ -752,10 +752,10 @@ public:
    * @param force_new True if we want to wait for new keys, false otherwise.
    * @return A pointer to the AuthAuthorizer, if we have one; NULL otherwise
    */
-  AuthAuthorizer *ms_deliver_get_authorizer(int peer_type, bool force_new) {
+  AuthAuthorizer *ms_deliver_get_authorizer(int peer_type) {
     AuthAuthorizer *a = 0;
     for (const auto& dispatcher : dispatchers) {
-      if (dispatcher->ms_get_authorizer(peer_type, &a, force_new))
+      if (dispatcher->ms_get_authorizer(peer_type, &a))
        return a;
     }
     return NULL;
index 7700cd2873abab174d1b8a0e8dff7821d878d47e..6cbd83a8baef75f4603c61215a24e15430d5c26e 100644 (file)
@@ -1419,8 +1419,7 @@ CtPtr ProtocolV1::send_connect_message() {
   ldout(cct, 20) << __func__ << dendl;
 
   if (!authorizer) {
-    authorizer = messenger->ms_deliver_get_authorizer(connection->peer_type,
-                                                     false);
+    authorizer = messenger->ms_deliver_get_authorizer(connection->peer_type);
   }
 
   ceph_msg_connect connect;
index 16d56ad7abf511da60f625aa7bfe85d557e69bcf..42cc204fdb6652a4d885ff9b8b84f15fdf3b6e64 100644 (file)
@@ -1450,7 +1450,7 @@ CtPtr ProtocolV2::send_connect_message() {
 
   if (!authorizer) {
     authorizer =
-        messenger->ms_deliver_get_authorizer(connection->peer_type, false);
+        messenger->ms_deliver_get_authorizer(connection->peer_type);
   }
 
   ceph_msg_connect connect;
index 9210224e50eab59923c8c08b75ebe04dd2f839de..de933aa49df338b78d0b5c9e19f2ecbb7986339a 100644 (file)
@@ -1146,7 +1146,7 @@ int Pipe::connect()
 
   while (1) {
     if (!authorizer) {
-      authorizer = msgr->ms_deliver_get_authorizer(peer_type, false);
+      authorizer = msgr->ms_deliver_get_authorizer(peer_type);
     }
     bufferlist authorizer_reply;
 
index 2539c3fdc159291e9672ce99286cbac4b297d3e5..5ba037bba153f2f81877fc74cd42fcb7a0055693 100644 (file)
@@ -7035,7 +7035,7 @@ void OSD::ms_fast_preprocess(Message *m)
   }
 }
 
-bool OSD::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new)
+bool OSD::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer)
 {
   dout(10) << "OSD::ms_get_authorizer type=" << ceph_entity_type_name(dest_type) << dendl;
 
@@ -7047,16 +7047,6 @@ bool OSD::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool for
   if (dest_type == CEPH_ENTITY_TYPE_MON)
     return true;
 
-  if (force_new) {
-    /* the MonClient checks keys every tick(), so we should just wait for that cycle
-       to get through */
-    auto timeout = g_conf().get_val<int64_t>("rotating_keys_renewal_timeout");
-    if (monc->wait_auth_rotating(timeout) < 0) {
-      derr << "OSD::ms_get_authorizer wait_auth_rotating failed" << dendl;
-      return false;
-    }
-  }
-
   *authorizer = monc->build_authorizer(dest_type);
   return *authorizer != NULL;
 }
index b875200bc3b79f0a5accd72886f7249efb3a25e7..6b0dface06fd7703209da6236b075c46bc8552b2 100644 (file)
@@ -1661,13 +1661,12 @@ public:
     int ms_handle_authentication(Connection *con) override {
       return true;
     }
-    bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer,
-                          bool force_new) override {
+    bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer) override {
       // some pre-nautilus OSDs get confused if you include an
       // authorizer but they are not expecting it.  do not try to authorize
       // heartbeat connections until all OSDs are nautilus.
       if (osd->get_osdmap()->require_osd_release >= CEPH_RELEASE_NAUTILUS) {
-       return osd->ms_get_authorizer(dest_type, authorizer, force_new);
+       return osd->ms_get_authorizer(dest_type, authorizer);
       }
       return false;
     }
@@ -2197,7 +2196,7 @@ private:
   void ms_fast_dispatch(Message *m) override;
   void ms_fast_preprocess(Message *m) override;
   bool ms_dispatch(Message *m) override;
-  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new) override;
+  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer) override;
   void ms_handle_connect(Connection *con) override;
   void ms_handle_fast_connect(Connection *con) override;
   void ms_handle_fast_accept(Connection *con) override;
index bececfc1283ff8f4b44e633025d354b083ca9fd1..ded800e8a675e3db031631c3a4d0ddf18d668912 100644 (file)
@@ -4415,8 +4415,7 @@ bool Objecter::ms_handle_refused(Connection *con)
 }
 
 bool Objecter::ms_get_authorizer(int dest_type,
-                                AuthAuthorizer **authorizer,
-                                bool force_new)
+                                AuthAuthorizer **authorizer)
 {
   if (!initialized)
     return false;
index cbb9517be1fd4879d889662ab68e1f070ad61dd9..3dfa1a2d7f70bec4d096974ad315ef7d96c76828 100644 (file)
@@ -3047,8 +3047,7 @@ public:
   void ms_handle_remote_reset(Connection *con) override;
   bool ms_handle_refused(Connection *con) override;
   bool ms_get_authorizer(int dest_type,
-                        AuthAuthorizer **authorizer,
-                        bool force_new) override;
+                        AuthAuthorizer **authorizer) override;
 
   void blacklist_self(bool set);
 
index 046d48971b41da231e429f164c3a3240ab142b99..7210ac35b56c4743976c3ff012d89764c95bea07 100644 (file)
@@ -60,7 +60,7 @@ struct Server {
           0, bufferlist{});
     }
     seastar::future<std::unique_ptr<AuthAuthorizer>>
-    ms_get_authorizer(peer_type_t, bool) override {
+    ms_get_authorizer(peer_type_t) override {
       return seastar::make_ready_future<std::unique_ptr<AuthAuthorizer>>(
           new DummyAuthAuthorizer{});
     }
index cc598237fec14e986db4480c0151b1f41001a6d0..a2d3bd46fc713d20ee714c286de0cc05b55172f8 100644 (file)
@@ -89,13 +89,12 @@ public:
    * @param a Double pointer to an AuthAuthorizer. The Dispatcher will fill
    * in *a with the correct AuthAuthorizer, if it can. Make sure that you have
    * set *a to NULL before calling in.
-   * @param force_new Force the Dispatcher to wait for a new set of keys before
-   * returning the authorizer.
    *
    * @return True if this function call properly filled in *a, false otherwise.
    */
-  bool ms_get_authorizer(int dest_type, AuthAuthorizer **a,
-                                bool force_new) override { return false; };
+  bool ms_get_authorizer(int dest_type, AuthAuthorizer **a) override {
+    return false;
+  };
 
   int ms_handle_authentication(Connection *con) override {
     return 1;
index 6ab9d92dd166781c0b1170d3f08db25233c772ce..519168610d5d4c8a93b5658269f4da9f11c22462 100644 (file)
@@ -89,13 +89,12 @@ public:
    * @param a Double pointer to an AuthAuthorizer. The Dispatcher will fill
    * in *a with the correct AuthAuthorizer, if it can. Make sure that you have
    * set *a to NULL before calling in.
-   * @param force_new Force the Dispatcher to wait for a new set of keys before
-   * returning the authorizer.
    *
    * @return True if this function call properly filled in *a, false otherwise.
    */
-  virtual bool ms_get_authorizer(int dest_type, AuthAuthorizer **a,
-                                bool force_new) { return false; };
+  virtual bool ms_get_authorizer(int dest_type, AuthAuthorizer **a) {
+    return false;
+  };
 
 
 };
index a262d2056e019fb2dbcb5633982526dcbb2b9c13..7e7da209bb6a5853ee5ce65e9d618429fc9dcc0c 100644 (file)
@@ -156,19 +156,11 @@ void MDSUtility::handle_fs_map(MFSMap* m)
 }
 
 
-bool MDSUtility::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer,
-                         bool force_new)
+bool MDSUtility::ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer)
 {
   if (dest_type == CEPH_ENTITY_TYPE_MON)
     return true;
 
-  if (force_new) {
-    auto timeout =
-      g_ceph_context->_conf.get_val<int64_t>("rotating_keys_renewal_timeout");
-    if (monc->wait_auth_rotating(timeout) < 0)
-      return false;
-  }
-
   *authorizer = monc->build_authorizer(dest_type);
   return *authorizer != NULL;
 }
index 21164bfaa87e0a601591bd159a16ad0f9009c856..e75a7192eb5947221754d5f940df37eaf6ada3ec 100644 (file)
@@ -51,8 +51,7 @@ public:
   bool ms_handle_reset(Connection *con) override { return false; }
   void ms_handle_remote_reset(Connection *con) override {}
   bool ms_handle_refused(Connection *con) override { return false; }
-  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer,
-                         bool force_new) override;
+  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer) override;
   int init();
   void shutdown();
 };