if (env.driver->get_name() == "rados") {
// add a watcher to respond to realm configuration changes
pusher = std::make_unique<RGWPeriodPusher>(dpp, env.driver, null_yield);
- fe_pauser = std::make_unique<RGWFrontendPauser>(fes, *(implicit_tenant_context.get()), pusher.get());
+ fe_pauser = std::make_unique<RGWFrontendPauser>(fes, pusher.get());
rgw_pauser = std::make_unique<RGWPauser>();
rgw_pauser->add_pauser(fe_pauser.get());
if (lua_background) {
rgw_pauser->add_pauser(lua_background.get());
}
- reloader = std::make_unique<RGWRealmReloader>(env, service_map_meta, rgw_pauser.get());
+ reloader = std::make_unique<RGWRealmReloader>(
+ env, *implicit_tenant_context, service_map_meta, rgw_pauser.get());
realm_watcher = std::make_unique<RGWRealmWatcher>(dpp, g_ceph_context,
static_cast<rgw::sal::RadosStore*>(env.driver)->svc()->zone->get_realm());
realm_watcher->add_watcher(RGWRealmNotify::Reload, *reloader);
void stop();
void join();
void pause();
- void unpause(rgw::sal::Driver* driver, rgw_auth_registry_ptr_t);
+ void unpause();
};
unsigned short parse_port(const char *input, boost::system::error_code& ec)
}
}
-void AsioFrontend::unpause(rgw::sal::Driver* const driver,
- rgw_auth_registry_ptr_t auth_registry)
+void AsioFrontend::unpause()
{
- env.driver = driver;
- env.auth_registry = std::move(auth_registry);
- lua_manager = driver->get_lua_manager();
+ lua_manager = env.driver->get_lua_manager();
// unpause to unblock connections
pause_mutex.unlock();
impl->pause();
}
-void RGWAsioFrontend::unpause_with_new_config(
- rgw::sal::Driver* const driver,
- rgw_auth_registry_ptr_t auth_registry
-) {
- impl->unpause(driver, std::move(auth_registry));
+void RGWAsioFrontend::unpause_with_new_config()
+{
+ impl->unpause();
}
void join() override;
void pause_for_new_config() override;
- void unpause_with_new_config(rgw::sal::Driver* driver,
- rgw_auth_registry_ptr_t auth_registry) override;
+ void unpause_with_new_config() override;
};
#endif // RGW_ASIO_FRONTEND_H
virtual void join() = 0;
virtual void pause_for_new_config() = 0;
- virtual void unpause_with_new_config(rgw::sal::Driver* driver,
- rgw_auth_registry_ptr_t auth_registry) = 0;
+ virtual void unpause_with_new_config() = 0;
};
pprocess->pause();
}
- void unpause_with_new_config(rgw::sal::Driver* const driver,
- rgw_auth_registry_ptr_t auth_registry) override {
- env.driver = driver;
- env.auth_registry = auth_registry;
- pprocess->unpause_with_new_config(driver, std::move(auth_registry));
+ void unpause_with_new_config() override {
+ pprocess->unpause_with_new_config();
}
}; /* RGWProcessFrontend */
class RGWFrontendPauser : public RGWRealmReloader::Pauser {
std::vector<RGWFrontend*> &frontends;
RGWRealmReloader::Pauser* pauser;
- rgw::auth::ImplicitTenants& implicit_tenants;
public:
RGWFrontendPauser(std::vector<RGWFrontend*> &frontends,
- rgw::auth::ImplicitTenants& implicit_tenants,
RGWRealmReloader::Pauser* pauser = nullptr)
- : frontends(frontends),
- pauser(pauser),
- implicit_tenants(implicit_tenants) {
- }
+ : frontends(frontends), pauser(pauser) {}
void pause() override {
for (auto frontend : frontends)
pauser->pause();
}
void resume(rgw::sal::Driver* driver) override {
- /* Initialize the registry of auth strategies which will coordinate
- * the dynamic reconfiguration. */
- auto auth_registry = \
- rgw::auth::StrategyRegistry::create(g_ceph_context, implicit_tenants, driver);
-
for (auto frontend : frontends)
- frontend->unpause_with_new_config(driver, auth_registry);
+ frontend->unpause_with_new_config();
if (pauser)
pauser->resume(driver);
}
m_tp.pause();
}
- void unpause_with_new_config(rgw::sal::Driver* const driver,
- rgw_auth_registry_ptr_t auth_registry) {
- env.driver = driver;
- env.auth_registry = std::move(auth_registry);
- lua_manager = driver->get_lua_manager();
+ void unpause_with_new_config() {
+ lua_manager = env.driver->get_lua_manager();
m_tp.unpause();
}
static constexpr bool USE_SAFE_TIMER_CALLBACKS = false;
-RGWRealmReloader::RGWRealmReloader(RGWProcessEnv& env, std::map<std::string, std::string>& service_map_meta,
+RGWRealmReloader::RGWRealmReloader(RGWProcessEnv& env,
+ const rgw::auth::ImplicitTenants& implicit_tenants,
+ std::map<std::string, std::string>& service_map_meta,
Pauser* frontends)
: env(env),
+ implicit_tenants(implicit_tenants),
service_map_meta(service_map_meta),
frontends(frontends),
timer(env.driver->ctx(), mutex, USE_SAFE_TIMER_CALLBACKS),
ldpp_dout(&dp, 1) << " - usage subsystem init" << dendl;
rgw_log_usage_init(cct, env.driver);
+ /* Initialize the registry of auth strategies which will coordinate
+ * the dynamic reconfiguration. */
+ env.auth_registry = rgw::auth::StrategyRegistry::create(
+ cct, implicit_tenants, env.driver);
+
ldpp_dout(&dp, 1) << "Resuming frontends with new realm configuration." << dendl;
frontends->resume(env.driver);
#include "rgw_sal_fwd.h"
struct RGWProcessEnv;
+namespace rgw::auth { class ImplicitTenants; }
/**
* RGWRealmReloader responds to new period notifications by recreating RGWRados
virtual void resume(rgw::sal::Driver* driver) = 0;
};
- RGWRealmReloader(RGWProcessEnv& env, std::map<std::string, std::string>& service_map_meta,
+ RGWRealmReloader(RGWProcessEnv& env,
+ const rgw::auth::ImplicitTenants& implicit_tenants,
+ std::map<std::string, std::string>& service_map_meta,
Pauser* frontends);
~RGWRealmReloader() override;
class C_Reload; //< Context that calls reload()
RGWProcessEnv& env;
+ const rgw::auth::ImplicitTenants& implicit_tenants;
std::map<std::string, std::string>& service_map_meta;
Pauser *const frontends;