Skip to content

Commit 3f640f9

Browse files
authored
Merge pull request ceph#63034 from thotz/cloud-restore-allow-copy-cloud-restored-temp-obj
rgw/cloud-restore: allow copy of temporary object
2 parents 948f603 + 6a3feca commit 3f640f9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/rgw/rgw_op.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5984,14 +5984,16 @@ void RGWCopyObj::execute(optional_yield y)
59845984
if (op_ret < 0) {
59855985
return;
59865986
}
5987+
obj_size = s->src_object->get_size();
59875988

59885989
/* Check if the src object is cloud-tiered */
59895990
bufferlist bl;
59905991
if (s->src_object->get_attr(RGW_ATTR_MANIFEST, bl)) {
59915992
RGWObjManifest m;
59925993
try{
59935994
decode(m, bl);
5994-
if (m.is_tier_type_s3()) {
5995+
// if object size is zero, then it transitioned object
5996+
if (m.is_tier_type_s3() && (obj_size == 0)) {
59955997
op_ret = -ERR_INVALID_OBJECT_STATE;
59965998
s->err.message = "This object was transitioned to cloud-s3";
59975999
ldpp_dout(this, 4) << "Cannot copy cloud tiered object. Failing with "
@@ -6006,8 +6008,7 @@ void RGWCopyObj::execute(optional_yield y)
60066008
}
60076009
}
60086010

6009-
obj_size = s->src_object->get_size();
6010-
6011+
60116012
if (!s->system_request) { // no quota enforcement for system requests
60126013
if (s->src_object->get_accounted_size() > static_cast<size_t>(s->cct->_conf->rgw_max_put_size)) {
60136014
op_ret = -ERR_TOO_LARGE;

0 commit comments

Comments
 (0)