class RGWMetaSyncProcessorThread : public RGWSyncProcessorThread
{
RGWMetaSyncStatusManager sync;
- rgw::sal::ConfigStore* cfgstore;
+ rgw::sal::ConfigStore *cfgstore{nullptr};
uint64_t interval_msec() override {
return 0; /* no interval associated, it'll run once until stopped */
sync.stop();
}
public:
- RGWMetaSyncProcessorThread(rgw::sal::RadosStore* _driver, RGWAsyncRadosProcessor *async_rados)
- : RGWSyncProcessorThread(_driver->getRados(), "meta-sync"), sync(_driver, async_rados) {}
+ RGWMetaSyncProcessorThread(rgw::sal::RadosStore* _driver, RGWAsyncRadosProcessor *async_rados,
+ rgw::sal::ConfigStore *_cfgstore)
+ : RGWSyncProcessorThread(_driver->getRados(), "meta-sync"), sync(_driver, async_rados), cfgstore(_cfgstore) {}
void wakeup_sync_shards(set<int>& shard_ids) {
for (set<int>::iterator iter = shard_ids.begin(); iter != shard_ids.end(); ++iter) {
}
public:
RGWDataSyncProcessorThread(rgw::sal::RadosStore* _driver, RGWAsyncRadosProcessor *async_rados,
- const RGWZone* source_zone)
+ const RGWZone* source_zone, rgw::sal::ConfigStore *_cfgstore)
: RGWSyncProcessorThread(_driver->getRados(), "data-sync"),
counters(sync_counters::build(store->ctx(), std::string("data-sync-from-") + source_zone->name)),
sync(_driver, async_rados, source_zone->id, counters.get()),
- initialized(false) {}
+ initialized(false), cfgstore(_cfgstore) {}
void wakeup_sync_shards(bc::flat_map<int, bc::flat_set<rgw_data_notify_entry> >& entries) {
for (bc::flat_map<int, bc::flat_set<rgw_data_notify_entry> >::iterator iter = entries.begin(); iter != entries.end(); ++iter) {
* Initialize the RADOS instance and prepare to do other ops
* Returns 0 on success, -ERR# on failure.
*/
-int RGWRados::init_complete(const DoutPrefixProvider *dpp, optional_yield y)
+int RGWRados::init_complete(const DoutPrefixProvider *dpp, optional_yield y, rgw::sal::ConfigStore* cfgstore)
{
int ret;
}
auto async_processor = svc.async_processor;
std::lock_guard l{meta_sync_thread_lock};
- meta_sync_processor_thread = new RGWMetaSyncProcessorThread(this->driver, async_processor);
+ meta_sync_processor_thread = new RGWMetaSyncProcessorThread(this->driver, async_processor, cfgstore);
ret = meta_sync_processor_thread->init(dpp);
if (ret < 0) {
ldpp_dout(dpp, 0) << "ERROR: failed to initialize meta sync thread" << dendl;
std::lock_guard dl{data_sync_thread_lock};
for (auto source_zone : svc.zone->get_data_sync_source_zones()) {
ldpp_dout(dpp, 5) << "starting data sync thread for zone " << source_zone->name << dendl;
- auto *thread = new RGWDataSyncProcessorThread(this->driver, svc.async_processor, source_zone);
+ auto *thread = new RGWDataSyncProcessorThread(this->driver, svc.async_processor, source_zone, cfgstore);
ret = thread->init(dpp);
if (ret < 0) {
ldpp_dout(dpp, 0) << "ERROR: failed to initialize data sync thread" << dendl;
/** Initialize the RADOS instance and prepare to do other ops */
int init_svc(bool raw, const DoutPrefixProvider *dpp, bool background_tasks, const rgw::SiteConfig& site, rgw::sal::ConfigStore* cfgstore);
virtual int init_rados();
- int init_complete(const DoutPrefixProvider *dpp, optional_yield y);
+ int init_complete(const DoutPrefixProvider *dpp, optional_yield y, rgw::sal::ConfigStore* cfgstore);
void finalize();
int register_to_service_map(const DoutPrefixProvider *dpp, const std::string& daemon_type, const std::map<std::string, std::string>& meta);
{
auto cct = driver->ctx();
- // initialize the period without reading from rados
- s->penv.cfgstore->read_period(this, y, driver->get_zone()->get_current_period_id(), std::nullopt, period);
-
// decode the period from input
const auto max_size = cct->_conf->rgw_max_put_param_size;
bool empty;
// if period id is empty, handle as 'period commit'
if (period.get_id().empty()) {
- if (op_ret < 0) {
- cerr << "Error initializing realm: " << cpp_strerror(-op_ret) << std::endl;
- return;
- }
op_ret = rgw::commit_period(this, y, s->penv.cfgstore, driver, realm, *realm_writer, current_period, period, error_stream, false);
if (op_ret == -EEXIST) {
op_ret = 0; // succeed on retries so the op is idempotent
// read realm
realm.reset(new RGWRealm(id, name));
- auto config_store_type = g_conf().get_val<std::string>("rgw_config_store");
op_ret = rgw::read_realm(this, y, s->penv.cfgstore, realm->get_id(), realm->get_name(), *realm);
if (op_ret < 0)
ldpp_dout(this, -1) << "failed to read realm id=" << id
false,
false, // No background tasks!
null_yield,
- cfgstore.get(),
+ cfgstore.get(),
need_cache && g_conf()->rgw_cache_enabled,
need_gc);
}
if (global) {
std::string realm_id = driver->get_zone()->get_realm_id();
RGWPeriodConfig period_config;
- auto config_store_type = g_conf().get_val<std::string>("rgw_config_store");
auto cfgstore = s->penv.cfgstore;
op_ret = cfgstore->read_period_config(this, y, realm_id, period_config);
if (op_ret && op_ret != -ENOENT) {
return;
}
- auto config_store_type = g_conf().get_val<std::string>("rgw_config_store");
auto cfgstore = s->penv.cfgstore;
if (global) {
std::string realm_id = driver->get_zone()->get_realm_id();
delete driver;
return nullptr;
}
- if (rados->init_complete(dpp, y) < 0) {
+ if (rados->init_complete(dpp, y, cfgstore) < 0) {
delete driver;
return nullptr;
}
delete driver;
return nullptr;
}
- if (rados->init_complete(dpp, y) < 0) {
+ if (rados->init_complete(dpp, y, cfgstore) < 0) {
delete driver;
return nullptr;
}
{
RGWSI_Zone *zone_svc{nullptr};
librados::Rados* rados{nullptr};
- rgw::sal::ConfigStore* cfgstore{nullptr};
class ClsSubService : public RGWServiceInstance {
friend class RGWSI_Cls;
RGWSI_Zone *zone_svc{nullptr};
librados::Rados *rados{nullptr};
RGWSI_Finisher *finisher_svc{nullptr};
- rgw::sal::ConfigStore *cfgstore{nullptr};
ceph::shared_mutex watchers_lock = ceph::make_shared_mutex("watchers_lock");
rgw_pool control_pool;
ObjectCache cache;
std::shared_ptr<RGWSI_SysObj_Cache_CB> cb;
- rgw::sal::ConfigStore *cfgstore{nullptr};
void normalize_pool_and_obj(const rgw_pool& src_pool, const std::string& src_obj, rgw_pool& dst_pool, std::string& dst_obj);
protected:
#include "rgw_aio_throttle.h"
#include "rgw_sal.h"
#include "rgw_sal_store.h"
+#include "rgw_sal_config.h"
#include "driver/dbstore/common/dbstore.h"
#include "rgw_sal_d4n.h"
#include "rgw_sal_filter.h"
DriverManager::Config cfg = DriverManager::get_config(true, g_ceph_context);
cfg.store_name = "dbstore";
cfg.filter_name = "d4n";
+ auto config_store_type = g_conf().get_val<std::string>("rgw_config_store");
+ auto cfgstore = DriverManager::create_config_store(env->dpp, config_store_type);
auto filterDriver = DriverManager::get_raw_storage(env->dpp, g_ceph_context,
- cfg, io, site_config);
+ cfg, io, site_config, cfgstore.get());
rgw::sal::Driver* next = filterDriver;
driver = newD4NFilter(next, io);