Skip to content

Commit

Permalink
rgw: fetch_remote_obj() takes optional olh epoch
Browse files Browse the repository at this point in the history
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit ff0280b)
  • Loading branch information
cbodley authored and Prashant D committed Jul 23, 2018
1 parent 53d218a commit 12487e1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/rgw/rgw_cr_rados.h
Expand Up @@ -741,7 +741,7 @@ class RGWAsyncFetchRemoteObj : public RGWAsyncRadosRequest {
RGWBucketInfo bucket_info;

rgw_obj_key key;
uint64_t versioned_epoch;
std::optional<uint64_t> versioned_epoch;

real_time src_mtime;

Expand All @@ -755,7 +755,7 @@ class RGWAsyncFetchRemoteObj : public RGWAsyncRadosRequest {
const string& _source_zone,
RGWBucketInfo& _bucket_info,
const rgw_obj_key& _key,
uint64_t _versioned_epoch,
std::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),
Expand All @@ -773,7 +773,7 @@ class RGWFetchRemoteObjCR : public RGWSimpleCoroutine {
RGWBucketInfo bucket_info;

rgw_obj_key key;
uint64_t versioned_epoch;
std::optional<uint64_t> versioned_epoch;

real_time src_mtime;

Expand All @@ -787,7 +787,7 @@ class RGWFetchRemoteObjCR : public RGWSimpleCoroutine {
const string& _source_zone,
RGWBucketInfo& _bucket_info,
const rgw_obj_key& _key,
uint64_t _versioned_epoch,
std::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),
Expand Down
6 changes: 4 additions & 2 deletions src/rgw/rgw_rados.cc
Expand Up @@ -7941,7 +7941,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx,
bool copy_if_newer,
map<string, bufferlist>& attrs,
RGWObjCategory category,
uint64_t olh_epoch,
std::optional<uint64_t> olh_epoch,
real_time delete_at,
string *version_id,
string *ptag,
Expand All @@ -7965,7 +7965,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;
Expand Down
2 changes: 1 addition & 1 deletion src/rgw/rgw_rados.h
Expand Up @@ -3190,7 +3190,7 @@ class RGWRados : public AdminSocketHook
bool copy_if_newer,
map<string, bufferlist>& attrs,
RGWObjCategory category,
uint64_t olh_epoch,
std::optional<uint64_t> olh_epoch,
ceph::real_time delete_at,
string *version_id,
string *ptag,
Expand Down

0 comments on commit 12487e1

Please sign in to comment.