From: Yehuda Sadeh Date: Wed, 3 Aug 2016 18:22:00 +0000 (-0700) Subject: rgw: define sync_module on RGWRados X-Git-Tag: v11.1.0~681^2~28 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2abd5ac847d02577ad5898a57fc9e58dca5615e6;p=ceph.git rgw: define sync_module on RGWRados Instead of having it as part of the data sync module. Since we only have a single sync_module, having it there will make it easier to get its properties. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index b93922413f78..0be2bd44a7b0 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -1611,12 +1611,7 @@ int RGWDataSyncStatusManager::init() RGWZoneParams& zone_params = store->get_zone_params(); - int r = store->get_sync_modules_manager()->create_instance(zone_def.tier_type, zone_params.tier_config, &sync_module); - if (r < 0) { - lderr(store->ctx()) << "ERROR: failed to init sync module instance, r=" << r << dendl; - finalize(); - return r; - } + sync_module = store->get_sync_module(); conn = store->get_zone_conn_by_id(source_zone); if (!conn) { @@ -1626,7 +1621,7 @@ int RGWDataSyncStatusManager::init() const char *log_pool = zone_params.log_pool.name.c_str(); librados::Rados *rados = store->get_rados_handle(); - r = rados->ioctx_create(log_pool, ioctx); + int r = rados->ioctx_create(log_pool, ioctx); if (r < 0) { lderr(store->ctx()) << "ERROR: failed to open log pool (" << zone_params.log_pool.name << " ret=" << r << dendl; return r; diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 84b63bd0e87a..58d7edbc0801 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -3792,6 +3792,12 @@ int RGWRados::init_complete() zone_short_id = current_period.get_map().get_zone_short_id(zone_params.get_id()); + ret = sync_modules_manager->create_instance(zone_public_config.tier_type, zone_params.tier_config, &sync_module); + if (ret < 0) { + lderr(cct) << "ERROR: failed to init sync module instance, ret=" << ret << dendl; + return ret; + } + init_unique_trans_id_deps(); finisher = new Finisher(cct); diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 209269332cf4..5c42ca02ca37 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -1902,6 +1902,7 @@ protected: RGWCoroutinesManagerRegistry *cr_registry; RGWSyncModulesManager *sync_modules_manager{nullptr}; + RGWSyncModuleInstanceRef sync_module; RGWZoneGroup zonegroup; RGWZone zone_public_config; /* external zone params, e.g., entrypoints, log flags, etc. */ @@ -2047,6 +2048,9 @@ public: RGWSyncModulesManager *get_sync_modules_manager() { return sync_modules_manager; } + const RGWSyncModuleInstanceRef& get_sync_module() { + return sync_module; + } int get_required_alignment(rgw_bucket& bucket, uint64_t *alignment); int get_max_chunk_size(rgw_bucket& bucket, uint64_t *max_chunk_size);