]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_rados: create sync module instances only if run_sync_thread is set 14994/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Mon, 8 May 2017 11:38:32 +0000 (13:38 +0200)
committerAbhishek Lekshmanan <alekshmanan@suse.com>
Fri, 19 May 2017 20:08:13 +0000 (22:08 +0200)
This allows for radosgw-admin to run even if there was a
misconfiguration in setting tier types which would otherwise make it
difficult to revert an invalid tier type setting. Since sync modules are
necessary only for rgw and not for the admin itself, this allows for
invalid tier configurations to be corrected as rgw-admin wouldn't fail

Fixes: http://tracker.ceph.com/issues/19830
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_rados.cc

index eb4fbeda6a2ad4d568186fca8c29d4b43b802143..47191e135354a49af78f768c864f2155ec947eae 100644 (file)
@@ -4029,10 +4029,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(cct, 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;
+  if (run_sync_thread) {
+    ret = sync_modules_manager->create_instance(cct, 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;
+    }
   }
 
   writeable_zone = (zone_public_config.tier_type.empty() || zone_public_config.tier_type == "rgw");