diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index e6cb001701515..87c83d6cd4f05 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -238,13 +238,15 @@ int RGWZoneGroup::equals(const string& other_zonegroup) const int RGWZoneGroup::add_zone(const RGWZoneParams& zone_params, bool *is_master, bool *read_only, const list& endpoints) { - if (is_master && *is_master) { - if (!master_zone.empty() && master_zone != zone_params.get_id()) { - ldout(cct, 0) << "NOTICE: overriding master zone: " << master_zone << dendl; + if (is_master) { + if (*is_master) { + if (!master_zone.empty() && master_zone != zone_params.get_id()) { + ldout(cct, 0) << "NOTICE: overriding master zone: " << master_zone << dendl; + } + master_zone = zone_params.get_id(); + } else if (master_zone == zone_params.get_id()) { + master_zone.clear(); } - master_zone = zone_params.get_id(); - } else if (master_zone == zone_params.get_id()) { - master_zone =""; } RGWZone& zone = zones[zone_params.get_id()];