diff options
author | shreyanshjain7174 <ssanchet@redhat.com> | 2024-08-05 09:44:52 +0200 |
---|---|---|
committer | Soumya Koduri <skoduri@redhat.com> | 2024-10-03 10:28:43 +0200 |
commit | 1b66bc527eb2ffa26a13816b4de310b3c25d8ace (patch) | |
tree | 24e08ee92d963016a91c84b518ff85ccd428b632 /src/rgw/driver | |
parent | cloud restore: completing read through (diff) | |
download | ceph-1b66bc527eb2ffa26a13816b4de310b3c25d8ace.tar.xz ceph-1b66bc527eb2ffa26a13816b4de310b3c25d8ace.zip |
RGW: Cloud Restore cli and its corresponding response for user.
* For first and repititive request 202 Accepted will be corresponding response code.
* For CloudRestored status 200 OK will be corresponding response code.
* For conflicting requests 409 Conflict corresponding response code.
Also Fixed storage class update while listing objects.
Earlier while restoring object temporarily list-objects (s3api) and
radosgw-admin bucket list didn't have updated storage class. With this
fixed it now has the cloudtier storage class.
Signed-off-by: shreyanshjain7174 <ssanchet@redhat.com>
Diffstat (limited to 'src/rgw/driver')
-rw-r--r-- | src/rgw/driver/rados/rgw_rados.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/rgw/driver/rados/rgw_rados.cc b/src/rgw/driver/rados/rgw_rados.cc index 868a798b79a..693d464d731 100644 --- a/src/rgw/driver/rados/rgw_rados.cc +++ b/src/rgw/driver/rados/rgw_rados.cc @@ -3213,6 +3213,30 @@ int RGWRados::Object::Write::_do_write_meta(uint64_t size, uint64_t accounted_si op.setxattr(RGW_ATTR_STORAGE_CLASS, bl); } + /* For temporary restored copies, storage-class returned + * in GET/list-objects should correspond to original + * cloudtier storage class. For GET its handled in its REST + * response by verifying RESTORE_TYPE in attrs. But the same + * cannot be done for list-objects response and hence this + * needs to be updated in bi entry itself. + */ + auto attr_iter = attrs.find(RGW_ATTR_RESTORE_TYPE); + if (attr_iter != attrs.end()) { + rgw::sal::RGWRestoreType rt; + bufferlist bl = attr_iter->second; + auto iter = bl.cbegin(); + decode(rt, iter); + + if (rt == rgw::sal::RGWRestoreType::Temporary) { + // temporary restore; set storage-class to cloudtier storage class + auto c_iter = attrs.find(RGW_ATTR_CLOUDTIER_STORAGE_CLASS); + + if (c_iter != attrs.end()) { + storage_class = rgw_bl_str(c_iter->second); + } + } + } + if (!op.size()) return 0; |