mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
rgw: RGWPeriod::reflect() sets master zonegroup as default
if RGWPeriod::reflect() is called right after a 'realm pull', it will create the zonegroup objects but not set any as default. so the next time RGWRados is initialized, create_defaults() will add a new 'default' zonegroup and set it as the master. this causes a 'period update' to find multiple master zonegroups and fail with EINVAL reflect() now calls set_as_default(exclusive=true) on the master zonegroup to guarantee that a default is set Signed-off-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
parent
18a5fddb90
commit
5230967dad
@ -1204,6 +1204,14 @@ int RGWPeriod::reflect()
|
||||
ldout(cct, 0) << "ERROR: failed to store zonegroup info for zonegroup=" << iter.first << ": " << cpp_strerror(-r) << dendl;
|
||||
return r;
|
||||
}
|
||||
if (zg.is_master_zonegroup()) {
|
||||
// set master as default if no default exists
|
||||
r = zg.set_as_default(true);
|
||||
if (r == 0) {
|
||||
ldout(cct, 1) << "Set the period's master zonegroup " << zg.get_id()
|
||||
<< " as the default" << dendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user