From: Casey Bodley Date: Mon, 16 May 2016 15:03:45 +0000 (-0400) Subject: rgw: add_zone only clears master_zone if --master=false X-Git-Tag: v11.0.0~492^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F9149%2Fhead;p=ceph.git rgw: add_zone only clears master_zone if --master=false Fixes: http://tracker.ceph.com/issues/15901 Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 5076d18d282..f8becbd3ede 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -253,13 +253,15 @@ int RGWZoneGroup::add_zone(const RGWZoneParams& zone_params, bool *is_master, bo } } - 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()];