From fcedda6e5dfbaff3975b4474d8546cf77f78cc83 Mon Sep 17 00:00:00 2001 From: weiqiaomiao Date: Wed, 24 Aug 2016 09:38:03 +0800 Subject: [PATCH] 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 --- src/rgw/rgw_rados.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 437cf3b3cc098..138f6b99a9bb3 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(); -- 2.39.5