]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fetch_remote_obj() takes optional olh epoch
authorCasey Bodley <cbodley@redhat.com>
Fri, 1 Jun 2018 13:09:44 +0000 (09:09 -0400)
committerNathan Cutler <ncutler@suse.com>
Wed, 12 Sep 2018 14:45:54 +0000 (16:45 +0200)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit ff0280b30180b73a53f08fc919febc03410e4c1e)

Conflicts:
    src/rgw/rgw_cr_rados.h
    src/rgw/rgw_rados.cc
    src/rgw/rgw_rados.h
- use boost::optional instead of std::optional

src/rgw/rgw_cr_rados.h
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index f4b9ea5fcdfcc4aa0d9d6fd74636598c6671da7f..e30646f6e1c394569e6764390adb82afa19d0c31 100644 (file)
@@ -741,7 +741,7 @@ class RGWAsyncFetchRemoteObj : public RGWAsyncRadosRequest {
   RGWBucketInfo bucket_info;
 
   rgw_obj_key key;
-  uint64_t versioned_epoch;
+  boost::optional<uint64_t> versioned_epoch;
 
   real_time src_mtime;
 
@@ -755,7 +755,7 @@ public:
                          const string& _source_zone,
                          RGWBucketInfo& _bucket_info,
                          const rgw_obj_key& _key,
-                         uint64_t _versioned_epoch,
+                         boost::optional<uint64_t> _versioned_epoch,
                          bool _if_newer, rgw_zone_set *_zones_trace) : RGWAsyncRadosRequest(caller, cn), store(_store),
                                                       source_zone(_source_zone),
                                                       bucket_info(_bucket_info),
@@ -773,7 +773,7 @@ class RGWFetchRemoteObjCR : public RGWSimpleCoroutine {
   RGWBucketInfo bucket_info;
 
   rgw_obj_key key;
-  uint64_t versioned_epoch;
+  boost::optional<uint64_t> versioned_epoch;
 
   real_time src_mtime;
 
@@ -787,7 +787,7 @@ public:
                       const string& _source_zone,
                       RGWBucketInfo& _bucket_info,
                       const rgw_obj_key& _key,
-                      uint64_t _versioned_epoch,
+                      boost::optional<uint64_t> _versioned_epoch,
                       bool _if_newer, rgw_zone_set *_zones_trace) : RGWSimpleCoroutine(_store->ctx()), cct(_store->ctx()),
                                        async_rados(_async_rados), store(_store),
                                        source_zone(_source_zone),
index eadbe61227fe549de6dce53de738e1170dcd8d29..c2265a2035c8e76f85adba36a61e39f495326a92 100644 (file)
@@ -7894,7 +7894,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx,
                bool copy_if_newer,
                map<string, bufferlist>& attrs,
                RGWObjCategory category,
-               uint64_t olh_epoch,
+               boost::optional<uint64_t> olh_epoch,
               real_time delete_at,
                string *version_id,
                string *ptag,
@@ -7918,7 +7918,9 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx,
   if (version_id && *version_id != "null") {
     processor.set_version_id(*version_id);
   }
-  processor.set_olh_epoch(olh_epoch);
+  if (olh_epoch) {
+    processor.set_olh_epoch(*olh_epoch);
+  }
   int ret = processor.prepare(this, NULL);
   if (ret < 0) {
     return ret;
index cf94303d6f9c18ab2e09b73fe721d01408f38d76..e2ae513a313ab5fa169dcc61e26678de4ca45b1f 100644 (file)
@@ -3156,7 +3156,7 @@ public:
                        bool copy_if_newer,
                        map<string, bufferlist>& attrs,
                        RGWObjCategory category,
-                       uint64_t olh_epoch,
+                       boost::optional<uint64_t> olh_epoch,
                       ceph::real_time delete_at,
                        string *version_id,
                        string *ptag,