From: Jiffin Tony Thottan Date: Tue, 29 Apr 2025 07:14:42 +0000 (+0530) Subject: rgw/cloud-restore: allow copy of temporary object X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6a3fecab1ffed2a9e9e7885e1625be3ccc745545;p=ceph.git rgw/cloud-restore: allow copy of temporary object Since storage class is cloud tier s3 cp of temporary object was failing. Fixes: https://tracker.ceph.com/issues/71121 Signed-off-by: Jiffin Tony Thottan --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 92fade2bfbb6..08ec28a06211 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -5984,6 +5984,7 @@ void RGWCopyObj::execute(optional_yield y) if (op_ret < 0) { return; } + obj_size = s->src_object->get_size(); /* Check if the src object is cloud-tiered */ bufferlist bl; @@ -5991,7 +5992,8 @@ void RGWCopyObj::execute(optional_yield y) RGWObjManifest m; try{ decode(m, bl); - if (m.is_tier_type_s3()) { + // if object size is zero, then it transitioned object + if (m.is_tier_type_s3() && (obj_size == 0)) { op_ret = -ERR_INVALID_OBJECT_STATE; s->err.message = "This object was transitioned to cloud-s3"; ldpp_dout(this, 4) << "Cannot copy cloud tiered object. Failing with " @@ -6006,8 +6008,7 @@ void RGWCopyObj::execute(optional_yield y) } } - obj_size = s->src_object->get_size(); - + if (!s->system_request) { // no quota enforcement for system requests if (s->src_object->get_accounted_size() > static_cast(s->cct->_conf->rgw_max_put_size)) { op_ret = -ERR_TOO_LARGE;