]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: create sync-module instance when radosgw-admin sync run 20611/head
authorlvshanchun <lvshanchun@gmail.com>
Tue, 27 Feb 2018 08:14:08 +0000 (16:14 +0800)
committerlvshanchun <lvshanchun@gmail.com>
Tue, 27 Feb 2018 08:14:08 +0000 (16:14 +0800)
Signed-off-by: lvshanchun <lvshanchun@gmail.com>
src/rgw/rgw_admin.cc

index 0e24d5a63547f526799f08905fd82fab7ce6d3ee..382b488e3db888331c30fc7b2e866eb223721981 100644 (file)
@@ -6480,17 +6480,9 @@ next:
       return EINVAL;
     }
 
-    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);
+    RGWDataSyncStatusManager sync(store, store->get_async_rados(), source_zone);
 
-    ret = sync.init();
+    int ret = sync.init();
     if (ret < 0) {
       cerr << "ERROR: sync.init() returned ret=" << ret << std::endl;
       return -ret;
@@ -6508,9 +6500,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;