diff options
author | Casey Bodley <cbodley@redhat.com> | 2022-10-13 22:43:02 +0200 |
---|---|---|
committer | Casey Bodley <cbodley@redhat.com> | 2023-03-13 00:07:38 +0100 |
commit | 646db2175f019e8d7279086d4593e94a6df95cf7 (patch) | |
tree | b95a1c53e8f0f922ec76e76665307222d48e9939 /src/rgw/rgw_realm_reloader.cc | |
parent | rgw/main: init_storage() creates a ConfigStore and loads SiteConfig (diff) | |
download | ceph-646db2175f019e8d7279086d4593e94a6df95cf7.tar.xz ceph-646db2175f019e8d7279086d4593e94a6df95cf7.zip |
rgw: RGWRealmReloader reloads rgw::SiteConfig
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Diffstat (limited to 'src/rgw/rgw_realm_reloader.cc')
-rw-r--r-- | src/rgw/rgw_realm_reloader.cc | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/src/rgw/rgw_realm_reloader.cc b/src/rgw/rgw_realm_reloader.cc index a9c314ed149..a691d4db3ea 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<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); } |