From: Casey Bodley Date: Thu, 13 Oct 2022 20:43:02 +0000 (-0400) Subject: rgw: RGWRealmReloader reloads rgw::SiteConfig X-Git-Tag: v19.0.0~1552^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F48482%2Fhead;p=ceph.git rgw: RGWRealmReloader reloads rgw::SiteConfig Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_realm_reloader.cc b/src/rgw/rgw_realm_reloader.cc index a9c314ed149b..a691d4db3eae 100644 --- a/src/rgw/rgw_realm_reloader.cc +++ b/src/rgw/rgw_realm_reloader.cc @@ -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("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("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); }