From: Yehuda Sadeh Date: Tue, 20 Nov 2018 11:29:28 +0000 (-0800) Subject: rgw: sync module can specify whether write ops supported X-Git-Tag: v14.1.0~616^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e32104ef1a23fbf00e21137fe7c10d84ca7b0d89;p=ceph.git rgw: sync module can specify whether write ops supported Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_data_sync.h b/src/rgw/rgw_data_sync.h index a31307acc9cf..4b253f7e9857 100644 --- a/src/rgw/rgw_data_sync.h +++ b/src/rgw/rgw_data_sync.h @@ -589,6 +589,7 @@ int rgw_bucket_sync_status(const DoutPrefixProvider *dpp, RGWRados *store, const class RGWDefaultSyncModule : public RGWSyncModule { public: RGWDefaultSyncModule() {} + bool supports_writes() override { return true; } bool supports_data_export() override { return true; } int create_instance(CephContext *cct, const JSONFormattable& config, RGWSyncModuleInstanceRef *instance) override; }; diff --git a/src/rgw/rgw_sync_module.h b/src/rgw/rgw_sync_module.h index f626489ec548..e3f59e1543e6 100644 --- a/src/rgw/rgw_sync_module.h +++ b/src/rgw/rgw_sync_module.h @@ -57,6 +57,9 @@ public: RGWSyncModule() {} virtual ~RGWSyncModule() {} + virtual bool supports_writes() { + return false; + } virtual bool supports_data_export() = 0; virtual int create_instance(CephContext *cct, const JSONFormattable& config, RGWSyncModuleInstanceRef *instance) = 0; }; diff --git a/src/rgw/services/svc_zone.cc b/src/rgw/services/svc_zone.cc index 13dbdd2a0e1e..013a3c2d1cd7 100644 --- a/src/rgw/services/svc_zone.cc +++ b/src/rgw/services/svc_zone.cc @@ -151,8 +151,13 @@ int RGWSI_Zone::do_start() zone_short_id = current_period->get_map().get_zone_short_id(zone_params->get_id()); -#warning FIXME - writeable_zone = (zone_public_config->tier_type.empty() || zone_public_config->tier_type == "rgw"); + RGWSyncModuleRef sm; + if (!sync_modules_svc->get_manager()->get_module(zone_public_config->tier_type, &sm)) { + lderr(cct) << "ERROR: tier type not found: " << zone_public_config->tier_type << dendl; + return -EINVAL; + } + + writeable_zone = sm->supports_writes(); /* first build all zones index */ for (auto ziter : zonegroup->zones) {