From: Orit Wasserman Date: Wed, 13 Jan 2016 12:55:54 +0000 (+0100) Subject: rgw: in create_default read zone_params in case we raced with another X-Git-Tag: v10.1.0~354^2~57 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=51eb2fad80618bfe84af1f3033c9467a0d2b5c26;p=ceph.git rgw: in create_default read zone_params in case we raced with another Signed-off-by: Orit Wasserman --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index a8197c0a51d..e1adb79bae1 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -158,8 +158,15 @@ int RGWZoneGroup::create_default(bool old_format) if (r < 0 && r != -EEXIST) { derr << "create_default: error in create_default zone params: " << cpp_strerror(-r) << dendl; return r; + } else if (r == -EEXIST) { + ldout(cct, 0) << "zone_params::create_default() returned -EEXIST, we raced with another zonegroup creation" << dendl; + r = zone_params.init(cct, store); + if (r < 0) { + derr << "create_default: error in init existing zone params: " << cpp_strerror(-r) << dendl; + } + return r; } - + RGWZone& default_zone = zones[zone_params.get_id()]; default_zone.name = zone_params.get_name(); default_zone.id = zone_params.get_id();