]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add s3 error message to cloud-tiered objects
authorCasey Bodley <cbodley@redhat.com>
Mon, 20 Feb 2023 13:52:39 +0000 (08:52 -0500)
committerSoumya Koduri <skoduri@redhat.com>
Tue, 23 May 2023 16:50:15 +0000 (22:20 +0530)
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 5713a040c38c5c17fa2ae4913067a602a412b639)

src/rgw/rgw_op.cc

index d166a22a457be14f9678b28dab604f3964d01d61..9d2de94970b34bcf694adb3b4babde5d648d00b7 100644 (file)
@@ -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&) {
@@ -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;
         }
@@ -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;
         }