Skip to content

Commit

Permalink
Merge pull request ceph#60832 from clwluvw/bucket-delete-meta
Browse files Browse the repository at this point in the history
rgw: consider multi zonegroup for is_syncing_bucket_meta

Reviewed-by: Casey Bodley <[email protected]>
  • Loading branch information
ivancich authored Jan 3, 2025
2 parents 49a44ce + 59cc81a commit ddfb774
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/rgw/driver/rados/rgw_datalog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/rgw/driver/rados/rgw_rados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5485,7 +5485,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) {
Expand Down
24 changes: 3 additions & 21 deletions src/rgw/services/svc_zone.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
}


Expand Down
2 changes: 1 addition & 1 deletion src/rgw/services/svc_zone.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class RGWSI_Zone : public RGWServiceInstance
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);
Expand Down

0 comments on commit ddfb774

Please sign in to comment.