]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: create sync-module instance when radosgw-admin sync run 20762/head
authorlvshanchun <lvshanchun@gmail.com>
Tue, 27 Feb 2018 08:14:08 +0000 (16:14 +0800)
committerPrashant D <pdhange@redhat.com>
Wed, 7 Mar 2018 00:30:49 +0000 (19:30 -0500)
Signed-off-by: lvshanchun <lvshanchun@gmail.com>
(cherry picked from commit a55797e093a110a2c86556fc5957948510a6f3f1)

src/rgw/rgw_admin.cc

index c40e18aaa998a21763cc4732c65fdf81d44b731c..fdfe9516b6797decd4ca1373f2392151d2c72275 100644 (file)
@@ -6423,17 +6423,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;
@@ -6451,9 +6443,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;