]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: in create_default read zone_params in case we raced with another
authorOrit Wasserman <owasserm@redhat.com>
Wed, 13 Jan 2016 12:55:54 +0000 (13:55 +0100)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:13:54 +0000 (16:13 -0800)
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
src/rgw/rgw_rados.cc

index a8197c0a51d17d6899b0a9d2a2afe1aca1d16511..e1adb79bae1fda1bea2bd377407253c8426a0f53 100644 (file)
@@ -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();