]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/cloud-restore: allow copy of temporary object cloud-restore-allow-copy-cloud-restored-temp-obj
authorJiffin Tony Thottan <thottanjiffin@gmail.com>
Tue, 29 Apr 2025 07:14:42 +0000 (12:44 +0530)
committerJiffin Tony Thottan <thottanjiffin@gmail.com>
Tue, 6 May 2025 10:00:19 +0000 (15:30 +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>
src/rgw/rgw_op.cc

index 81c32f5449b8684d7b70cfa714ba307bc0db29ca..cfebfafce14ad516abdeb2295935863d44edeb01 100644 (file)
@@ -5931,6 +5931,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;
@@ -5938,7 +5939,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 "
@@ -5953,8 +5955,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;