From: Orit Wasserman Date: Wed, 21 Jun 2017 09:37:21 +0000 (+0300) Subject: rgw: log_meta only for more than one zone X-Git-Tag: v12.1.1~166^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=088dba03ccc65609ef1c51306389ebcf1126ec8c;p=ceph.git rgw: log_meta only for more than one zone Fixes: http://tracker.ceph.com/issues/20357 Signed-off-by: Orit Wasserman --- diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 9018cbbf392f..ce1678e4d4c6 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -1874,6 +1874,22 @@ public: 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); @@ -3570,7 +3586,8 @@ public: } bool need_to_log_metadata() { - return is_meta_master() && get_zone().log_meta; + return is_meta_master() && + (get_zonegroup().zones.size() > 1 || current_period.is_multi_zonegroups_with_zones()); } librados::Rados* get_rados_handle();