]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: allow init complete to proceed in case of erroneus zone deletes
authorAbhishek Lekshmanan <abhishek@suse.com>
Mon, 19 Nov 2018 16:21:15 +0000 (17:21 +0100)
committerAbhishek Lekshmanan <abhishek@suse.com>
Mon, 19 Nov 2018 17:37:07 +0000 (18:37 +0100)
Currently a master zone delete in a zonegroup followed by a period commit would
render RGWRados to be unusable, check if the zonegroup is empty and continue
initialization in these cases so that removal can proceed.

Fixes: http://tracker.ceph.com/issues/37328
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/services/svc_zone.cc

index 3b95a4500467125be4eb3ead681890a59f605c8e..2e1e67706808ee62627c9ba93c36025b72d822d7 100644 (file)
@@ -606,6 +606,9 @@ int RGWSI_Zone::init_zg_from_period(bool *initialized)
     // use endpoints from the zonegroup's master zone
     auto master = zg.zones.find(zg.master_zone);
     if (master == zg.zones.end()) {
+      // Check for empty zonegroup which can happen if zone was deleted before removal
+      if (zg.zones.size() == 0)
+        continue;
       // fix missing master zone for a single zone zonegroup
       if (zg.master_zone.empty() && zg.zones.size() == 1) {
        master = zg.zones.begin();