From 6a3fecab1ffed2a9e9e7885e1625be3ccc745545 Mon Sep 17 00:00:00 2001 From: Jiffin Tony Thottan Date: Tue, 29 Apr 2025 12:44:42 +0530 Subject: [PATCH] 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 --- src/rgw/rgw_op.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 92fade2bfbb66..08ec28a062110 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; -- 2.39.5