From 95232d610413aa964d567bf0e788546732ec49ff Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 1 Jun 2018 09:09:44 -0400 Subject: [PATCH] rgw: fetch_remote_obj() takes optional olh epoch Signed-off-by: Casey Bodley (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 | 8 ++++---- src/rgw/rgw_rados.cc | 6 ++++-- src/rgw/rgw_rados.h | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/rgw/rgw_cr_rados.h b/src/rgw/rgw_cr_rados.h index f4b9ea5fcdfcc..e30646f6e1c39 100644 --- a/src/rgw/rgw_cr_rados.h +++ b/src/rgw/rgw_cr_rados.h @@ -741,7 +741,7 @@ class RGWAsyncFetchRemoteObj : public RGWAsyncRadosRequest { RGWBucketInfo bucket_info; rgw_obj_key key; - uint64_t versioned_epoch; + boost::optional 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 _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 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 _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), diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index eadbe61227fe5..c2265a2035c8e 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -7894,7 +7894,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx, bool copy_if_newer, map& attrs, RGWObjCategory category, - uint64_t olh_epoch, + boost::optional 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; diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index cf94303d6f9c1..e2ae513a313ab 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -3156,7 +3156,7 @@ public: bool copy_if_newer, map& attrs, RGWObjCategory category, - uint64_t olh_epoch, + boost::optional olh_epoch, ceph::real_time delete_at, string *version_id, string *ptag, -- 2.39.5