]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix period update --commit return error 10836/head
authorweiqiaomiao <wei.qiaomiao@zte.com.cn>
Wed, 24 Aug 2016 01:38:03 +0000 (09:38 +0800)
committerweiqiaomiao <wei.qiaomiao@zte.com.cn>
Wed, 24 Aug 2016 01:38:03 +0000 (09:38 +0800)
period commit return error when the current period has a zonegroup which doesn't have a master zone

Fixes: http://tracker.ceph.com/issues/17110
Signed-off-by: weiqiaomiao <wei.qiaomiao@zte.com.cn>
src/rgw/rgw_rados.cc

index 437cf3b3cc0988f3291c851609dfee17b8e9e6c4..138f6b99a9bb3c837aadac7172e5fbf24d393ee7 100644 (file)
@@ -1207,6 +1207,11 @@ int RGWPeriod::update()
       ldout(cct, 20) << "skipping zonegroup " << zg.get_name() << " zone realm id " << zg.realm_id << ", not on our realm " << realm_id << dendl;
       continue;
     }
+
+    if (zg.master_zone.empty()) {
+      ldout(cct, 0) << "ERROR: zonegroup " << zg.get_name() << " should have a master zone " << dendl;
+      return -EINVAL;
+    }  
     
     if (zg.is_master_zonegroup()) {
       master_zonegroup = zg.get_id();