mirror of
https://github.com/ceph/ceph
synced 2025-02-22 18:47:18 +00:00
Merge pull request #18898 from Leeshine/wip-rgw-bug-22080
rgw: create sync-module instance when execute radosgw-admin data sync run Reviewed-by: Orit Wasserman <owasserm@redhat.com>
This commit is contained in:
commit
de57814fbf
@ -6470,9 +6470,18 @@ next:
|
||||
cerr << "ERROR: source zone not specified" << std::endl;
|
||||
return EINVAL;
|
||||
}
|
||||
RGWDataSyncStatusManager sync(store, store->get_async_rados(), source_zone);
|
||||
|
||||
int ret = sync.init();
|
||||
RGWSyncModuleInstanceRef sync_module;
|
||||
int ret = store->get_sync_modules_manager()->create_instance(g_ceph_context, store->get_zone().tier_type,
|
||||
store->get_zone_params().tier_config, &sync_module);
|
||||
if (ret < 0) {
|
||||
lderr(cct) << "ERROR: failed to init sync module instance, ret=" << ret << dendl;
|
||||
return ret;
|
||||
}
|
||||
|
||||
RGWDataSyncStatusManager sync(store, store->get_async_rados(), source_zone, sync_module);
|
||||
|
||||
ret = sync.init();
|
||||
if (ret < 0) {
|
||||
cerr << "ERROR: sync.init() returned ret=" << ret << std::endl;
|
||||
return -ret;
|
||||
|
@ -1775,7 +1775,9 @@ int RGWDataSyncStatusManager::init()
|
||||
|
||||
RGWZoneParams& zone_params = store->get_zone_params();
|
||||
|
||||
sync_module = store->get_sync_module();
|
||||
if (sync_module == nullptr) {
|
||||
sync_module = store->get_sync_module();
|
||||
}
|
||||
|
||||
conn = store->get_zone_conn_by_id(source_zone);
|
||||
if (!conn) {
|
||||
|
@ -311,6 +311,12 @@ public:
|
||||
: store(_store), source_zone(_source_zone), conn(NULL), error_logger(NULL),
|
||||
sync_module(nullptr),
|
||||
source_log(store, async_rados, observer), num_shards(0) {}
|
||||
RGWDataSyncStatusManager(RGWRados *_store, RGWAsyncRadosProcessor *async_rados,
|
||||
const string& _source_zone, const RGWSyncModuleInstanceRef& _sync_module,
|
||||
rgw::BucketChangeObserver *observer = nullptr)
|
||||
: store(_store), source_zone(_source_zone), conn(NULL), error_logger(NULL),
|
||||
sync_module(_sync_module),
|
||||
source_log(store, async_rados, observer), num_shards(0) {}
|
||||
~RGWDataSyncStatusManager() {
|
||||
finalize();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user