]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Read `sync status` from only the zones allowed to sync from 53410/head
authorSoumya Koduri <skoduri@redhat.com>
Wed, 5 Jul 2023 12:15:39 +0000 (17:45 +0530)
committerMykola Golub <mgolub@suse.com>
Tue, 12 Sep 2023 08:08:12 +0000 (11:08 +0300)
Using multisite sync policy, zones within a zonegroup can be configured
not to sync from certain zones. Filter such zones while reading sync
status.

Fixes: https://tracker.ceph.com/issues/62014
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
(cherry picked from commit 094460c26b8fdd9a72667800b54a0cfaa5409c88)

Conflicts:
src/rgw/rgw_admin.cc (store vs driver, no static cast)
src/rgw/services/svc_zone.cc (trivial)
src/rgw/services/svc_zone.h (trivial)

src/rgw/rgw_admin.cc
src/rgw/services/svc_zone.cc
src/rgw/services/svc_zone.h

index 3299f549b8d604d4e249f80236858d4c4a5124d7..423dcee62ac1f250274793d774ee1977143330c7 100644 (file)
@@ -2057,7 +2057,7 @@ static void get_data_sync_status(const rgw_zone_id& source_zone, list<string>& s
     return;
   }
 
-  if (!store->svc()->zone->zone_syncs_from(store->svc()->zone->get_zone(), *sz)) {
+  if (!store->svc()->zone->zone_syncs_from(*sz)) {
     push_ss(ss, status, tab) << string("not syncing from zone");
     flush_ss(ss, status);
     return;
index c12db48004d6a529a980f2824e25ba6857da72eb..1e2feeabe6927d0c357e2a77e540b18333e3ca83 100644 (file)
@@ -64,6 +64,21 @@ bool RGWSI_Zone::zone_syncs_from(const RGWZone& target_zone, const RGWZone& sour
          sync_modules_svc->get_manager()->supports_data_export(source_zone.tier_type);
 }
 
+bool RGWSI_Zone::zone_syncs_from(const RGWZone& source_zone) const
+{
+  auto target_zone = get_zone();
+  bool found = false;
+
+  for (auto s : data_sync_source_zones) {
+    if (s->id == source_zone.id) {
+      found = true;
+      break;
+    }
+  }
+  return found && target_zone.syncs_from(source_zone.name) &&
+         sync_modules_svc->get_manager()->supports_data_export(source_zone.tier_type);
+}
+
 int RGWSI_Zone::do_start(optional_yield y, const DoutPrefixProvider *dpp)
 {
   int ret = sysobj_svc->start(y, dpp);
index 9f503df5e4146d9cd391f919de1f11c8509ba49c..bddc0e20467b0e2fe8993e45eae94ac37c144aa5 100644 (file)
@@ -94,6 +94,7 @@ public:
 
   bool zone_is_writeable();
   bool zone_syncs_from(const RGWZone& target_zone, const RGWZone& source_zone) const;
+  bool zone_syncs_from(const RGWZone& source_zone) const;
   bool get_redirect_zone_endpoint(string *endpoint);
   bool sync_module_supports_writes() const { return writeable_zone; }
   bool sync_module_exports_data() const { return exports_data; }