]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't start the bucket notification thread in radosgw-admin
authorYuval Lifshitz <ylifshit@redhat.com>
Mon, 6 Mar 2023 17:44:41 +0000 (19:44 +0200)
committerYuval Lifshitz <ylifshit@redhat.com>
Tue, 7 Mar 2023 12:18:17 +0000 (14:18 +0200)
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
src/rgw/driver/rados/rgw_rados.cc
src/rgw/driver/rados/rgw_rados.h
src/rgw/rgw_admin.cc
src/rgw/rgw_appmain.cc
src/rgw/rgw_object_expirer.cc
src/rgw/rgw_realm_reloader.cc
src/rgw/rgw_sal.cc
src/rgw/rgw_sal.h

index 0c82be3f0f4d31b02e277ff79aa8865233b85aa4..3f2332db482ef22416d1f76407c8254883a2b726 100644 (file)
@@ -1065,7 +1065,9 @@ void RGWRados::finalize()
   delete reshard;
   delete index_completion_manager;
 
-  rgw::notify::shutdown();
+  if (run_notification_thread) {
+    rgw::notify::shutdown();
+  }
 }
 
 /** 
@@ -1314,9 +1316,12 @@ int RGWRados::init_complete(const DoutPrefixProvider *dpp)
   }
 
   index_completion_manager = new RGWIndexCompletionManager(this);
-  ret = rgw::notify::init(cct, driver, dpp);
-  if (ret < 0 ) {
-    ldpp_dout(dpp, 1) << "ERROR: failed to initialize notification manager" << dendl;
+
+  if (run_notification_thread) {
+    ret = rgw::notify::init(cct, driver, dpp);
+    if (ret < 0 ) {
+      ldpp_dout(dpp, 1) << "ERROR: failed to initialize notification manager" << dendl;
+    }
   }
 
   return ret;
index 869742922964d2b45b69f4bb7401429cce35be2c..87f798128764329daeeae80229cad696a8cbff55 100644 (file)
@@ -367,6 +367,7 @@ class RGWRados
   bool quota_threads;
   bool run_sync_thread;
   bool run_reshard_thread;
+  bool run_notification_thread;
 
   RGWMetaNotifier *meta_notifier;
   RGWDataNotifier *data_notifier;
@@ -450,7 +451,7 @@ protected:
 public:
   RGWRados(): timer(NULL),
                gc(NULL), lc(NULL), obj_expirer(NULL), use_gc_thread(false), use_lc_thread(false), quota_threads(false),
-               run_sync_thread(false), run_reshard_thread(false), meta_notifier(NULL),
+               run_sync_thread(false), run_reshard_thread(false), run_notification_thread(false), meta_notifier(NULL),
                data_notifier(NULL), meta_sync_processor_thread(NULL),
                bucket_index_max_shards(0),
                max_bucket_id(0), cct(NULL),
@@ -512,6 +513,11 @@ public:
     run_reshard_thread = _run_reshard_thread;
     return *this;
   }
+  
+  RGWRados& set_run_notification_thread(bool _run_notification_thread) {
+    run_notification_thread = _run_notification_thread;
+    return *this;
+  }
 
   librados::IoCtx* get_lc_pool_ctx() {
     return &lc_pool_ctx;
index 8745b5b3dd4b38e18af28164b5120d4e6a186bb7..32eb80b19d1ba3c67bc9b80bd90ab7a2aba58d99 100644 (file)
@@ -4242,6 +4242,7 @@ int main(int argc, const char **argv)
                                        false,
                                        false,
                                        false,
+                                        false,
                                        need_cache && g_conf()->rgw_cache_enabled,
                                        need_gc);
     }
index 361f622b992a70428b99a0e130c1c846012b2c8f..64c3258a54b38f713293c3d3670fe9b55ae1dc90 100644 (file)
@@ -222,6 +222,7 @@ void rgw::AppMain::init_storage()
           run_quota,
           run_sync,
           g_conf().get_val<bool>("rgw_dynamic_resharding"),
+          true, // run notification thread
           g_conf()->rgw_cache_enabled);
 
 } /* init_storage */
index fd36a49c6fb22110e9d8b05ce8615ecbaa6c362c..c0a13e435135a98901c76168550a14d6a5ce891c 100644 (file)
@@ -83,7 +83,7 @@ int main(const int argc, const char **argv)
   DriverManager::Config cfg;
   cfg.store_name = "rados";
   cfg.filter_name = "none";
-  driver = DriverManager::get_storage(&dp, g_ceph_context, cfg, false, false, false, false, false);
+  driver = DriverManager::get_storage(&dp, g_ceph_context, cfg, false, false, false, false, false, false);
   if (!driver) {
     std::cerr << "couldn't init storage provider" << std::endl;
     return EIO;
index 182cf16392f2310b245ef4268a224d6fb9a06828..a9c314ed149b2800870908c651e98e60662a6c19 100644 (file)
@@ -121,6 +121,7 @@ void RGWRealmReloader::reload()
                                   cct->_conf->rgw_enable_quota_threads,
                                   cct->_conf->rgw_run_sync_thread,
                                   cct->_conf.get_val<bool>("rgw_dynamic_resharding"),
+                                   true, // run notification thread
                                   cct->_conf->rgw_cache_enabled);
 
     ldpp_dout(&dp, 1) << "Creating new driver" << dendl;
index 58a21f707f58eb9e682b432b0b986b0a5cc7379e..714b10abf19197fe051008fa038d102c411f3401 100644 (file)
@@ -100,6 +100,7 @@ rgw::sal::Driver* DriverManager::init_storage_provider(const DoutPrefixProvider*
                                                     bool quota_threads,
                                                     bool run_sync_thread,
                                                     bool run_reshard_thread,
+                                                     bool run_notification_thread,
                                                     bool use_cache,
                                                     bool use_gc)
 {
@@ -117,6 +118,7 @@ rgw::sal::Driver* DriverManager::init_storage_provider(const DoutPrefixProvider*
                 .set_run_quota_threads(quota_threads)
                 .set_run_sync_thread(run_sync_thread)
                 .set_run_reshard_thread(run_reshard_thread)
+                .set_run_notification_thread(run_notification_thread)
                 .init_begin(cct, dpp) < 0) {
       delete driver;
       return nullptr;
@@ -143,6 +145,7 @@ rgw::sal::Driver* DriverManager::init_storage_provider(const DoutPrefixProvider*
                 .set_run_quota_threads(quota_threads)
                 .set_run_sync_thread(run_sync_thread)
                 .set_run_reshard_thread(run_reshard_thread)
+                .set_run_notification_thread(run_notification_thread)
                 .init_begin(cct, dpp) < 0) {
       delete driver;
       return nullptr;
index 037806d6854a9eddbbef67956475e415c28dd033..0d756758cc4c7c8ae2b71a8f1b60b420dd3d41e9 100644 (file)
@@ -1576,6 +1576,7 @@ public:
                                      bool quota_threads,
                                      bool run_sync_thread,
                                      bool run_reshard_thread,
+                                     bool run_notification_thread,
                                      bool use_cache = true,
                                      bool use_gc = true) {
     rgw::sal::Driver* driver = init_storage_provider(dpp, cct, cfg, use_gc_thread,
@@ -1583,6 +1584,7 @@ public:
                                                   quota_threads,
                                                   run_sync_thread,
                                                   run_reshard_thread,
+                                                   run_notification_thread,
                                                   use_cache, use_gc);
     return driver;
   }
@@ -1601,6 +1603,7 @@ public:
                                                bool quota_threads,
                                                bool run_sync_thread,
                                                bool run_reshard_thread,
+                                                bool run_notification_thread,
                                                bool use_metadata_cache,
                                                bool use_gc);
   /** Initialize a new raw Driver */