Skip to content

Commit

Permalink
rgw: add_zone only clears master_zone if --master=false
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/15901

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 40c4d15)
  • Loading branch information
cbodley committed May 31, 2016
1 parent cd6ed4d commit 933fdef
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/rgw/rgw_rados.cc
Expand Up @@ -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<string>& 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()];
Expand Down

0 comments on commit 933fdef

Please sign in to comment.