From e46fc5022cc029544bc985b317622ed405bedf08 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Mon, 8 May 2017 13:38:32 +0200 Subject: [PATCH] rgw_rados: create sync module instances only if run_sync_thread is set 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 --- src/rgw/rgw_rados.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index eb4fbeda6a2ad..47191e135354a 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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");