If we are deleting a master zone of a zonegroup fail on period update, if this
was intentional, either creating / modifying a zone as master or in case of
deletions, deletion of the zonegroup itself will correct the period update to
work correctly. Without the check, while period commit will be successful a
subsequent RGWRados::init_complete() will fail.
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit
3bea89096857230ecd6137ec6fe551c4ae20ae37)
src/rgw/rgw_zone.cc
Changes made to corresponding function rgw_rados
return -EINVAL;
}
+ if (zg.zones.find(zg.master_zone) == zg.zones.end()) {
+ ldout(cct,0) << "ERROR: zonegroup " << zg.get_name()
+ << " has a non existent master zone "<< dendl;
+ return -EINVAL;
+ }
+
if (zg.is_master_zonegroup()) {
master_zonegroup = zg.get_id();
master_zone = zg.master_zone;