mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
rgw/multisite: unify zg is_master judge
Signed-off-by: Jiaying Ren <jiaying.ren@umcloud.com>
This commit is contained in:
parent
db13592398
commit
96db3d7fd0
@ -490,7 +490,7 @@ int rgw_build_bucket_policies(RGWRados* store, struct req_state* s)
|
||||
/* we now need to make sure that the operation actually requires copy source, that is
|
||||
* it's a copy operation
|
||||
*/
|
||||
if (store->get_zonegroup().is_master && s->system_request) {
|
||||
if (store->get_zonegroup().is_master_zonegroup() && s->system_request) {
|
||||
/*If this is the master, don't redirect*/
|
||||
} else if (!s->local_source ||
|
||||
(s->op != OP_PUT && s->op != OP_COPY) ||
|
||||
@ -2394,7 +2394,7 @@ void RGWCreateBucket::execute()
|
||||
if (op_ret < 0)
|
||||
return;
|
||||
|
||||
if (!store->get_zonegroup().is_master &&
|
||||
if (!store->get_zonegroup().is_master_zonegroup() &&
|
||||
store->get_zonegroup().api_name != location_constraint) {
|
||||
ldout(s->cct, 0) << "location constraint (" << location_constraint << ")"
|
||||
<< " doesn't match zonegroup" << " (" << store->get_zonegroup().api_name << ")"
|
||||
@ -5540,7 +5540,7 @@ bool RGWBulkDelete::Deleter::delete_single(const acct_path_t& path)
|
||||
goto delop_fail;
|
||||
}
|
||||
|
||||
if (!store->get_zonegroup().is_master) {
|
||||
if (!store->get_zonegroup().is_master_zonegroup()) {
|
||||
bufferlist in_data;
|
||||
ret = forward_request_to_master(s, &ot.read_version, store, in_data,
|
||||
nullptr);
|
||||
|
@ -1852,7 +1852,7 @@ void RGWPeriodMap::decode(bufferlist::iterator& bl) {
|
||||
iter != zonegroups.end(); ++iter) {
|
||||
RGWZoneGroup& zonegroup = iter->second;
|
||||
zonegroups_by_api[zonegroup.api_name] = zonegroup;
|
||||
if (zonegroup.is_master) {
|
||||
if (zonegroup.is_master_zonegroup()) {
|
||||
master_zonegroup = zonegroup.get_id();
|
||||
}
|
||||
}
|
||||
@ -1873,7 +1873,7 @@ static uint32_t gen_short_zone_id(const std::string zone_id)
|
||||
|
||||
int RGWPeriodMap::update(const RGWZoneGroup& zonegroup, CephContext *cct)
|
||||
{
|
||||
if (zonegroup.is_master && (!master_zonegroup.empty() && zonegroup.get_id() != master_zonegroup)) {
|
||||
if (zonegroup.is_master_zonegroup() && (!master_zonegroup.empty() && zonegroup.get_id() != master_zonegroup)) {
|
||||
ldout(cct,0) << "Error updating periodmap, multiple master zonegroups configured "<< dendl;
|
||||
ldout(cct,0) << "master zonegroup: " << master_zonegroup << " and " << zonegroup.get_id() <<dendl;
|
||||
return -EINVAL;
|
||||
@ -1891,7 +1891,7 @@ int RGWPeriodMap::update(const RGWZoneGroup& zonegroup, CephContext *cct)
|
||||
zonegroups_by_api[zonegroup.api_name] = zonegroup;
|
||||
}
|
||||
|
||||
if (zonegroup.is_master) {
|
||||
if (zonegroup.is_master_zonegroup()) {
|
||||
master_zonegroup = zonegroup.get_id();
|
||||
} else if (master_zonegroup == zonegroup.get_id()) {
|
||||
master_zonegroup = "";
|
||||
@ -1993,7 +1993,7 @@ void RGWZoneGroupMap::decode(bufferlist::iterator& bl) {
|
||||
iter != zonegroups.end(); ++iter) {
|
||||
RGWZoneGroup& zonegroup = iter->second;
|
||||
zonegroups_by_api[zonegroup.api_name] = zonegroup;
|
||||
if (zonegroup.is_master) {
|
||||
if (zonegroup.is_master_zonegroup()) {
|
||||
master_zonegroup = zonegroup.get_name();
|
||||
}
|
||||
}
|
||||
@ -3942,7 +3942,7 @@ int RGWRados::replace_region_with_zonegroup()
|
||||
ldout(cct, 0) << __func__ << " failed init region "<< *iter << ": " << cpp_strerror(-ret) << dendl;
|
||||
return ret;
|
||||
}
|
||||
if (region.is_master) {
|
||||
if (region.is_master_zonegroup()) {
|
||||
master_region = region.get_id();
|
||||
master_zone = region.master_zone;
|
||||
}
|
||||
@ -4234,7 +4234,7 @@ int RGWRados::init_zg_from_local(bool *creating_defaults)
|
||||
}
|
||||
}
|
||||
ldout(cct, 20) << "zonegroup " << zonegroup.get_name() << dendl;
|
||||
if (zonegroup.is_master) {
|
||||
if (zonegroup.is_master_zonegroup()) {
|
||||
// use endpoints from the zonegroup's master zone
|
||||
auto master = zonegroup.zones.find(zonegroup.master_zone);
|
||||
if (master == zonegroup.zones.end()) {
|
||||
@ -8175,7 +8175,7 @@ int RGWRados::copy_obj_data(RGWObjectCtx& obj_ctx,
|
||||
|
||||
bool RGWRados::is_meta_master()
|
||||
{
|
||||
if (!get_zonegroup().is_master) {
|
||||
if (!get_zonegroup().is_master_zonegroup()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -8196,7 +8196,7 @@ bool RGWRados::is_syncing_bucket_meta(const rgw_bucket& bucket)
|
||||
}
|
||||
|
||||
/* zonegroup is not master zonegroup */
|
||||
if (!get_zonegroup().is_master) {
|
||||
if (!get_zonegroup().is_master_zonegroup()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user