]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #14915 from cbodley/wip-19817
authorYuri Weinstein <yuri.weinstein@gmail.com>
Fri, 14 Jul 2017 15:52:52 +0000 (08:52 -0700)
committerGitHub <noreply@github.com>
Fri, 14 Jul 2017 15:52:52 +0000 (08:52 -0700)
rgw: add missing RGWPeriod::reflect() based on new atomic update_latest_epoch()

Reviewed-by: Orit Wasserman <owasserm@redhat.com>
1  2 
src/rgw/rgw_admin.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

Simple merge
Simple merge
index 86631926d42d676fd5bca75700e2e67b1cb499db,0ae433257fd069eb9eeca5f519d87f33a0eb77d0..6b996c960bfbfb886bf098babdeec958aa6ea41a
@@@ -1867,29 -1870,13 +1868,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);