]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/cloud-restore: allow copy of temporary object 63944/head
authorJiffin Tony Thottan <thottanjiffin@gmail.com>
Tue, 29 Apr 2025 07:14:42 +0000 (12:44 +0530)
committerJiffin Tony Thottan <thottanjiffin@gmail.com>
Mon, 16 Jun 2025 06:08:44 +0000 (11:38 +0530)
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 <thottanjiffin@gmail.com>
(cherry picked from commit 6a3fecab1ffed2a9e9e7885e1625be3ccc745545)
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
src/rgw/rgw_op.cc

index 3c6d9bd96f9aed601ed9d02faf2b99537bbf1510..45f3fe48973985a4b88c1aa3ee4e67689734639e 100644 (file)
@@ -5930,6 +5930,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;
@@ -5937,7 +5938,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 "
@@ -5952,8 +5954,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<size_t>(s->cct->_conf->rgw_max_put_size)) {
         op_ret = -ERR_TOO_LARGE;