]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: sync module can specify whether write ops supported
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 20 Nov 2018 11:29:28 +0000 (03:29 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 11 Dec 2018 09:00:21 +0000 (01:00 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_data_sync.h
src/rgw/rgw_sync_module.h
src/rgw/services/svc_zone.cc

index a31307acc9cf7aad3ec4ea1e77f829642dc299e5..4b253f7e985706b509c7208b037ed4fc1c801fdd 100644 (file)
@@ -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;
 };
index f626489ec5481c12c2baf33b21ad140e10daa411..e3f59e1543e6d90ebcbb4cd2f07777831600fb40 100644 (file)
@@ -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;
 };
index 13dbdd2a0e1e699fe13c70117bcbd52dbfd7fe7f..013a3c2d1cd70260db530c3c8f3ba3d8740d660d 100644 (file)
@@ -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) {