]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add missing master_zone when running with old default region config 10205/head
authorOrit Wasserman <owasserm@redhat.com>
Fri, 8 Jul 2016 08:41:59 +0000 (10:41 +0200)
committerOrit Wasserman <owasserm@redhat.com>
Fri, 8 Jul 2016 08:41:59 +0000 (10:41 +0200)
Fixes: http://tracker.ceph.com/issues/16627
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
src/rgw/rgw_rados.cc

index 9e072479cd6bdad51881ce2fbeab8a51b7e0dbf8..61db69b81d6baeba373a511f8b268e76a335fad0 100644 (file)
@@ -3355,6 +3355,17 @@ int RGWRados::replace_region_with_zonegroup()
       zoneparams.metadata_heap = ".rgw.meta";
       return zoneparams.update();
     }
+    /* update master zone */
+    RGWZoneGroup default_zg(default_zonegroup_name);
+    ret = default_zg.init(cct, this);
+    if (ret < 0 && ret != -ENOENT) {
+      ldout(cct, 0) << __func__ << ": error in initializing default zonegroup: " << cpp_strerror(-ret) << dendl;
+      return ret;
+    }
+    if (ret != -ENOENT && default_zg.master_zone.empty()) {
+      default_zg.master_zone = zoneparams.get_id();
+      return default_zg.update();
+    }
     return 0;
   }