summaryrefslogtreecommitdiffstats
path: root/src/rgw
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2023-04-19 20:03:28 +0200
committerSoumya Koduri <skoduri@redhat.com>2023-05-01 16:00:58 +0200
commitcec19b09efc5a56a5f5600000675b951428b98ce (patch)
tree13aca391af0b1cf674da6894634df1580fdfe308 /src/rgw
parentrgw/cloudtier: Fix bug with decoding tier_targets (diff)
downloadceph-cec19b09efc5a56a5f5600000675b951428b98ce.tar.xz
ceph-cec19b09efc5a56a5f5600000675b951428b98ce.zip
rgw/cloudtransition: Allow multisite zones to sync cloudtiered objects
In a multisite configuration, zones should be able to fetch & sync cloud-transitioned objects as well. To allow this, a new header 'x-rgwx-sync-cloudtiered' is added to be used by sync client to GET such objects. Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Diffstat (limited to 'src/rgw')
-rw-r--r--src/rgw/driver/rados/rgw_rados.cc6
-rw-r--r--src/rgw/rgw_op.cc2
-rw-r--r--src/rgw/rgw_op.h1
-rw-r--r--src/rgw/rgw_rest_conn.cc5
-rw-r--r--src/rgw/rgw_rest_conn.h4
-rw-r--r--src/rgw/rgw_rest_s3.cc3
6 files changed, 17 insertions, 4 deletions
diff --git a/src/rgw/driver/rados/rgw_rados.cc b/src/rgw/driver/rados/rgw_rados.cc
index bd487989370..83532b02308 100644
--- a/src/rgw/driver/rados/rgw_rados.cc
+++ b/src/rgw/driver/rados/rgw_rados.cc
@@ -3788,10 +3788,11 @@ int RGWRados::stat_remote_obj(const DoutPrefixProvider *dpp,
constexpr bool rgwx_stat = true;
constexpr bool sync_manifest = true;
constexpr bool skip_decrypt = true;
+ constexpr bool sync_cloudtiered = true;
int ret = conn->get_obj(dpp, user_id, info, src_obj, pmod, unmod_ptr,
dest_mtime_weight.zone_short_id, dest_mtime_weight.pg_ver,
prepend_meta, get_op, rgwx_stat,
- sync_manifest, skip_decrypt,
+ sync_manifest, skip_decrypt, sync_cloudtiered,
true, &cb, &in_stream_req);
if (ret < 0) {
return ret;
@@ -4003,10 +4004,11 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx,
static constexpr bool rgwx_stat = false;
static constexpr bool sync_manifest = true;
static constexpr bool skip_decrypt = true;
+ static constexpr bool sync_cloudtiered = true;
ret = conn->get_obj(dpp, user_id, info, src_obj, pmod, unmod_ptr,
dest_mtime_weight.zone_short_id, dest_mtime_weight.pg_ver,
prepend_meta, get_op, rgwx_stat,
- sync_manifest, skip_decrypt,
+ sync_manifest, skip_decrypt, sync_cloudtiered,
true,
&cb, &in_stream_req);
if (ret < 0) {
diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc
index 592d49f7327..731dc101d4d 100644
--- a/src/rgw/rgw_op.cc
+++ b/src/rgw/rgw_op.cc
@@ -2262,7 +2262,7 @@ void RGWGetObj::execute(optional_yield y)
RGWObjManifest m;
try {
decode(m, attr_iter->second);
- if (m.get_tier_type() == "cloud-s3") {
+ if (m.get_tier_type() == "cloud-s3" && !sync_cloudtiered) {
/* XXX: Instead send presigned redirect or read-through */
op_ret = -ERR_INVALID_OBJECT_STATE;
s->err.message = "This object was transitioned to cloud-s3";
diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h
index 97404d0c7ec..a2d39c83a7f 100644
--- a/src/rgw/rgw_op.h
+++ b/src/rgw/rgw_op.h
@@ -353,6 +353,7 @@ protected:
bool range_parsed;
bool skip_manifest;
bool skip_decrypt{false};
+ bool sync_cloudtiered{false};
utime_t gc_invalidate_time;
bool is_slo;
std::string lo_etag;
diff --git a/src/rgw/rgw_rest_conn.cc b/src/rgw/rgw_rest_conn.cc
index 8722ff22879..21ddf6b718f 100644
--- a/src/rgw/rgw_rest_conn.cc
+++ b/src/rgw/rgw_rest_conn.cc
@@ -203,6 +203,7 @@ int RGWRESTConn::get_obj(const DoutPrefixProvider *dpp, const rgw_user& uid, req
uint32_t mod_zone_id, uint64_t mod_pg_ver,
bool prepend_metadata, bool get_op, bool rgwx_stat,
bool sync_manifest, bool skip_decrypt,
+ bool sync_cloudtiered,
bool send, RGWHTTPStreamRWRequest::ReceiveCB *cb, RGWRESTStreamRWRequest **req)
{
get_obj_params params;
@@ -215,6 +216,7 @@ int RGWRESTConn::get_obj(const DoutPrefixProvider *dpp, const rgw_user& uid, req
params.rgwx_stat = rgwx_stat;
params.sync_manifest = sync_manifest;
params.skip_decrypt = skip_decrypt;
+ params.sync_cloudtiered = sync_cloudtiered;
params.cb = cb;
return get_obj(dpp, obj, params, send, req);
}
@@ -237,6 +239,9 @@ int RGWRESTConn::get_obj(const DoutPrefixProvider *dpp, const rgw_obj& obj, cons
if (in_params.sync_manifest) {
params.push_back(param_pair_t(RGW_SYS_PARAM_PREFIX "sync-manifest", ""));
}
+ if (in_params.sync_cloudtiered) {
+ params.push_back(param_pair_t(RGW_SYS_PARAM_PREFIX "sync-cloudtiered", ""));
+ }
if (in_params.skip_decrypt) {
params.push_back(param_pair_t(RGW_SYS_PARAM_PREFIX "skip-decrypt", ""));
}
diff --git a/src/rgw/rgw_rest_conn.h b/src/rgw/rgw_rest_conn.h
index c916b97378d..bb0d5a8bbf8 100644
--- a/src/rgw/rgw_rest_conn.h
+++ b/src/rgw/rgw_rest_conn.h
@@ -154,6 +154,7 @@ public:
bool get_op{false};
bool rgwx_stat{false};
bool sync_manifest{false};
+ bool sync_cloudtiered{false};
bool skip_decrypt{true};
RGWHTTPStreamRWRequest::ReceiveCB *cb{nullptr};
@@ -169,7 +170,8 @@ public:
const ceph::real_time *mod_ptr, const ceph::real_time *unmod_ptr,
uint32_t mod_zone_id, uint64_t mod_pg_ver,
bool prepend_metadata, bool get_op, bool rgwx_stat, bool sync_manifest,
- bool skip_decrypt, bool send, RGWHTTPStreamRWRequest::ReceiveCB *cb, RGWRESTStreamRWRequest **req);
+ bool skip_decrypt, bool sync_cloudtiered,
+ bool send, RGWHTTPStreamRWRequest::ReceiveCB *cb, RGWRESTStreamRWRequest **req);
int complete_request(RGWRESTStreamRWRequest *req,
std::string *etag,
ceph::real_time *mtime,
diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc
index 54da6d09ca0..715c59641a8 100644
--- a/src/rgw/rgw_rest_s3.cc
+++ b/src/rgw/rgw_rest_s3.cc
@@ -299,6 +299,9 @@ int RGWGetObj_ObjStore_S3::get_params(optional_yield y)
skip_decrypt = s->info.args.exists(RGW_SYS_PARAM_PREFIX "skip-decrypt");
}
+ // multisite sync requests should fetch cloudtiered objects
+ sync_cloudtiered = s->info.args.exists(RGW_SYS_PARAM_PREFIX "sync-cloudtiered");
+
get_torrent = s->info.args.exists("torrent");
return RGWGetObj_ObjStore::get_params(y);