Skip to content

Commit 59cc81a

Browse files
committed
rgw: consider multi zonegroup for is_syncing_bucket_meta
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 <[email protected]>
1 parent 2360022 commit 59cc81a

File tree

4 files changed

+6
-24
lines changed

4 files changed

+6
-24
lines changed

src/rgw/driver/rados/rgw_datalog.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ int RGWDataChangesLog::renew_entries(const DoutPrefixProvider *dpp)
576576
if (ret < 0) {
577577
/* we don't really need to have a special handling for failed cases here,
578578
* as this is just an optimization. */
579-
ldpp_dout(dpp, -1) << "ERROR: svc.cls->timelog.add() returned " << ret << dendl;
579+
ldpp_dout(dpp, -1) << "ERROR: be->push() returned " << ret << dendl;
580580
return ret;
581581
}
582582

src/rgw/driver/rados/rgw_rados.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5445,7 +5445,7 @@ int RGWRados::delete_bucket(RGWBucketInfo& bucket_info, RGWObjVersionTracker& ob
54455445
}
54465446

54475447
/* if the bucket is not synced we can remove the meta file */
5448-
if (!svc.zone->is_syncing_bucket_meta(bucket)) {
5448+
if (!svc.zone->is_syncing_bucket_meta()) {
54495449
RGWObjVersionTracker objv_tracker;
54505450
r = ctl.bucket->remove_bucket_instance_info(bucket, bucket_info, y, dpp);
54515451
if (r < 0) {

src/rgw/services/svc_zone.cc

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,7 @@ bool RGWSI_Zone::is_meta_master() const
743743

744744
bool RGWSI_Zone::need_to_log_metadata() const
745745
{
746-
return is_meta_master() &&
747-
(zonegroup->zones.size() > 1 || current_period->is_multi_zonegroups_with_zones());
746+
return is_meta_master() && is_syncing_bucket_meta();
748747
}
749748

750749
bool RGWSI_Zone::can_reshard() const
@@ -761,33 +760,16 @@ bool RGWSI_Zone::can_reshard() const
761760

762761
/**
763762
* Check to see if the bucket metadata could be synced
764-
* bucket: the bucket to check
765763
* Returns false is the bucket is not synced
766764
*/
767-
bool RGWSI_Zone::is_syncing_bucket_meta(const rgw_bucket& bucket)
765+
bool RGWSI_Zone::is_syncing_bucket_meta() const
768766
{
769-
770767
/* no current period */
771768
if (current_period->get_id().empty()) {
772769
return false;
773770
}
774771

775-
/* zonegroup is not master zonegroup */
776-
if (!zonegroup->is_master_zonegroup()) {
777-
return false;
778-
}
779-
780-
/* single zonegroup and a single zone */
781-
if (current_period->is_single_zonegroup() && zonegroup->zones.size() == 1) {
782-
return false;
783-
}
784-
785-
/* zone is not master */
786-
if (zonegroup->master_zone != zone_public_config->id) {
787-
return false;
788-
}
789-
790-
return true;
772+
return zonegroup->zones.size() > 1 || current_period->is_multi_zonegroups_with_zones();
791773
}
792774

793775

src/rgw/services/svc_zone.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class RGWSI_Zone : public RGWServiceInstance
146146
bool need_to_log_data() const;
147147
bool need_to_log_metadata() const;
148148
bool can_reshard() const;
149-
bool is_syncing_bucket_meta(const rgw_bucket& bucket);
149+
bool is_syncing_bucket_meta() const;
150150

151151
int list_zonegroups(const DoutPrefixProvider *dpp, std::list<std::string>& zonegroups);
152152
int list_regions(const DoutPrefixProvider *dpp, std::list<std::string>& regions);

0 commit comments

Comments
 (0)