]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: RGWRealmReloader reloads rgw::SiteConfig
authorCasey Bodley <cbodley@redhat.com>
Thu, 13 Oct 2022 20:43:02 +0000 (16:43 -0400)
committerCasey Bodley <cbodley@redhat.com>
Sun, 12 Mar 2023 23:07:38 +0000 (19:07 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_realm_reloader.cc

index a9c314ed149b2800870908c651e98e60662a6c19..a691d4db3eae9bad3b0987dbc7f430bc0e7d5073 100644 (file)
@@ -109,22 +109,24 @@ void RGWRealmReloader::reload()
 
 
   while (!env.driver) {
-    // recreate and initialize a new driver
-    DriverManager::Config cfg;
-    cfg.store_name = "rados";
-    cfg.filter_name = "none";
-    env.driver =
-      DriverManager::get_storage(&dp, cct,
-                                  cfg,
-                                  cct->_conf->rgw_enable_gc_threads,
-                                  cct->_conf->rgw_enable_lc_threads,
-                                  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;
+    // reload the new configuration from ConfigStore
+    int r = env.site->load(&dp, null_yield, env.cfgstore);
+    if (r == 0) {
+      ldpp_dout(&dp, 1) << "Creating new driver" << dendl;
+
+      // recreate and initialize a new driver
+      DriverManager::Config cfg;
+      cfg.store_name = "rados";
+      cfg.filter_name = "none";
+      env.driver = DriverManager::get_storage(&dp, cct, cfg,
+          cct->_conf->rgw_enable_gc_threads,
+          cct->_conf->rgw_enable_lc_threads,
+          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);
+    }
 
     rgw::sal::Driver* store_cleanup = nullptr;
     {
@@ -135,13 +137,13 @@ void RGWRealmReloader::reload()
       // sleep until we get another notification, and retry until we get
       // a working configuration
       if (env.driver == nullptr) {
-        ldpp_dout(&dp, -1) << "Failed to reinitialize RGWRados after a realm "
+        ldpp_dout(&dp, -1) << "Failed to reload realm after a period "
             "configuration update. Waiting for a new update." << dendl;
 
         // sleep until another event is scheduled
        cond.wait(lock, [this] { return reload_scheduled; });
-        ldout(cct, 1) << "Woke up with a new configuration, retrying "
-            "RGWRados initialization." << dendl;
+        ldpp_dout(&dp, 1) << "Woke up with a new configuration, retrying "
+            "realm reload." << dendl;
       }
 
       if (reload_scheduled) {
@@ -156,8 +158,8 @@ void RGWRealmReloader::reload()
     }
 
     if (store_cleanup) {
-      ldpp_dout(&dp, 4) << "Got another notification, restarting RGWRados "
-          "initialization." << dendl;
+      ldpp_dout(&dp, 4) << "Got another notification, restarting realm "
+          "reload." << dendl;
 
       DriverManager::close_storage(store_cleanup);
     }