Skip to content

Commit

Permalink
rgw: add s3 error message to cloud-tiered objects
Browse files Browse the repository at this point in the history
better to tell the s3 client why their request failed than to log it as
an ERROR; this is normal/expected when cloud tiering is enabled

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 5713a04)
  • Loading branch information
cbodley authored and soumyakoduri committed May 23, 2023
1 parent 9e476ee commit b70d27f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/rgw/rgw_op.cc
Expand Up @@ -2283,8 +2283,9 @@ void RGWGetObj::execute(optional_yield y)
if (m.get_tier_type() == "cloud-s3") {
/* XXX: Instead send presigned redirect or read-through */
op_ret = -ERR_INVALID_OBJECT_STATE;
ldpp_dout(this, 0) << "ERROR: Cannot get cloud tiered object. Failing with "
<< op_ret << dendl;
s->err.message = "This object was transitioned to cloud-s3";
ldpp_dout(this, 4) << "Cannot get cloud tiered object. Failing with "
<< op_ret << dendl;
goto done_err;
}
} catch (const buffer::end_of_buffer&) {
Expand Down Expand Up @@ -4090,7 +4091,8 @@ void RGWPutObj::execute(optional_yield y)
decode(m, bl);
if (m.get_tier_type() == "cloud-s3") {
op_ret = -ERR_INVALID_OBJECT_STATE;
ldpp_dout(this, 0) << "ERROR: Cannot copy cloud tiered object. Failing with "
s->err.message = "This object was transitioned to cloud-s3";
ldpp_dout(this, 4) << "Cannot copy cloud tiered object. Failing with "
<< op_ret << dendl;
return;
}
Expand Down Expand Up @@ -5547,7 +5549,8 @@ void RGWCopyObj::execute(optional_yield y)
decode(m, bl);
if (m.get_tier_type() == "cloud-s3") {
op_ret = -ERR_INVALID_OBJECT_STATE;
ldpp_dout(this, 0) << "ERROR: Cannot copy cloud tiered object. Failing with "
s->err.message = "This object was transitioned to cloud-s3";
ldpp_dout(this, 4) << "Cannot copy cloud tiered object. Failing with "
<< op_ret << dendl;
return;
}
Expand Down

0 comments on commit b70d27f

Please sign in to comment.