From: weiqiaomiao Date: Wed, 24 Aug 2016 01:38:03 +0000 (+0800) Subject: rgw: fix period update --commit return error X-Git-Tag: v11.0.1~395^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F10836%2Fhead;p=ceph.git rgw: fix period update --commit return error 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 --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 437cf3b3cc09..138f6b99a9bb 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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();