From: Nathan Cutler Date: Tue, 12 Sep 2017 19:58:54 +0000 (+0200) Subject: Merge pull request #17148 from smithfarm/wip-20292-jewel X-Git-Tag: v10.2.10~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fbae1127a6e7a9f4dd0822a91c8a06e5b95e3c52;p=ceph.git Merge pull request #17148 from smithfarm/wip-20292-jewel jewel: rgw: multisite: log_meta on secondary zone causes continuous loop of metadata sync Reviewed-by: Yehuda Sadeh --- fbae1127a6e7a9f4dd0822a91c8a06e5b95e3c52 diff --cc src/rgw/rgw_rados.h index 88a8fd2ef3a2,9c3de8fdb233..b2e82c6c4dd7 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@@ -1498,13 -1496,29 +1498,32 @@@ public int get_zonegroup(RGWZoneGroup& zonegroup, const string& zonegroup_id); - bool is_single_zonegroup(CephContext *cct, RGWRados *store); + bool is_single_zonegroup() + { + return (period_map.zonegroups.size() == 1); + } + + /* + returns true if there are several zone groups with a least one zone + */ + bool is_multi_zonegroups_with_zones() + { + int count = 0; + for (const auto& zg: period_map.zonegroups) { + if (zg.second.zones.size() > 0) { + if (count++ > 0) { + return true; + } + } + } + return false; + } int get_latest_epoch(epoch_t& epoch); - int set_latest_epoch(epoch_t epoch, bool exclusive = false); + int set_latest_epoch(epoch_t epoch, bool exclusive = false, + RGWObjVersionTracker *objv = nullptr); + // update latest_epoch if the given epoch is higher, else return -EEXIST + int update_latest_epoch(epoch_t epoch); int init(CephContext *_cct, RGWRados *_store, const string &period_realm_id, const string &period_realm_name = "", bool setup_obj = true);