]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: consider multi zonegroup for is_syncing_bucket_meta 60832/head
authorSeena Fallah <seenafallah@gmail.com>
Tue, 26 Nov 2024 00:15:31 +0000 (01:15 +0100)
committerSeena Fallah <seenafallah@gmail.com>
Tue, 26 Nov 2024 00:22:55 +0000 (01:22 +0100)
Updated is_syncing_bucket_meta() to account for multi-zone and
multi-zonegroup scenarios during this check.

Fixes: https://tracker.ceph.com/issues/69049
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
src/rgw/driver/rados/rgw_datalog.cc
src/rgw/driver/rados/rgw_rados.cc
src/rgw/services/svc_zone.cc
src/rgw/services/svc_zone.h

index 4c9503071ef173329d188610ebf9241b949088ac..d7e57d7e1c15d933ac396c32b35e46215d23f08b 100644 (file)
@@ -576,7 +576,7 @@ int RGWDataChangesLog::renew_entries(const DoutPrefixProvider *dpp)
     if (ret < 0) {
       /* we don't really need to have a special handling for failed cases here,
        * as this is just an optimization. */
-      ldpp_dout(dpp, -1) << "ERROR: svc.cls->timelog.add() returned " << ret << dendl;
+      ldpp_dout(dpp, -1) << "ERROR: be->push() returned " << ret << dendl;
       return ret;
     }
 
index a133b54dc595f91a61c3c96ca529211285050068..38b9e3ccc08795d311fc4f20610e539a457d2867 100644 (file)
@@ -5445,7 +5445,7 @@ int RGWRados::delete_bucket(RGWBucketInfo& bucket_info, RGWObjVersionTracker& ob
   }
 
   /* if the bucket is not synced we can remove the meta file */
-  if (!svc.zone->is_syncing_bucket_meta(bucket)) {
+  if (!svc.zone->is_syncing_bucket_meta()) {
     RGWObjVersionTracker objv_tracker;
     r = ctl.bucket->remove_bucket_instance_info(bucket, bucket_info, y, dpp);
     if (r < 0) {
index 70cf40eb6cb61789b6e827cd91e146b8cc6478d8..61360135dd948259b101b4972bff2a7efd0761cb 100644 (file)
@@ -743,8 +743,7 @@ bool RGWSI_Zone::is_meta_master() const
 
 bool RGWSI_Zone::need_to_log_metadata() const
 {
-  return is_meta_master() &&
-    (zonegroup->zones.size() > 1 || current_period->is_multi_zonegroups_with_zones());
+  return is_meta_master() && is_syncing_bucket_meta();
 }
 
 bool RGWSI_Zone::can_reshard() const
@@ -761,33 +760,16 @@ bool RGWSI_Zone::can_reshard() const
 
 /**
   * Check to see if the bucket metadata could be synced
-  * bucket: the bucket to check
   * Returns false is the bucket is not synced
   */
-bool RGWSI_Zone::is_syncing_bucket_meta(const rgw_bucket& bucket)
+bool RGWSI_Zone::is_syncing_bucket_meta() const
 {
-
   /* no current period  */
   if (current_period->get_id().empty()) {
     return false;
   }
 
-  /* zonegroup is not master zonegroup */
-  if (!zonegroup->is_master_zonegroup()) {
-    return false;
-  }
-
-  /* single zonegroup and a single zone */
-  if (current_period->is_single_zonegroup() && zonegroup->zones.size() == 1) {
-    return false;
-  }
-
-  /* zone is not master */
-  if (zonegroup->master_zone != zone_public_config->id) {
-    return false;
-  }
-
-  return true;
+  return zonegroup->zones.size() > 1 || current_period->is_multi_zonegroups_with_zones();
 }
 
 
index c4a3a28f0d7b0c2a49a193e4068346bb4fd079ac..1b3f49587a34b014199a126a8dadec44276b1b87 100644 (file)
@@ -146,7 +146,7 @@ public:
   bool need_to_log_data() const;
   bool need_to_log_metadata() const;
   bool can_reshard() const;
-  bool is_syncing_bucket_meta(const rgw_bucket& bucket);
+  bool is_syncing_bucket_meta() const;
 
   int list_zonegroups(const DoutPrefixProvider *dpp, std::list<std::string>& zonegroups);
   int list_regions(const DoutPrefixProvider *dpp, std::list<std::string>& regions);