]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: optimizations for handling ECANCELED errors within get_obj_state 47187/head
authorCory Snyder <csnyder@iland.com>
Mon, 25 Jul 2022 20:04:09 +0000 (16:04 -0400)
committerCory Snyder <csnyder@iland.com>
Mon, 25 Jul 2022 20:04:12 +0000 (16:04 -0400)
These optimizations for handling ECANCELED errors should prevent
some needless RADOS queries upstream.

Signed-off-by: Cory Snyder <csnyder@iland.com>
src/rgw/rgw_rados.cc

index 2bbec2b1fbdf31aad6ead6bc1c7a6baf569b697b..620a4066788734d901259d60ef67b86ca56e6ee5 100644 (file)
@@ -7362,9 +7362,6 @@ int RGWRados::apply_olh_log(const DoutPrefixProvider *dpp,
 
   /* update olh object */
   r = rgw_rados_operate(dpp, ref.pool.ioctx(), ref.obj.oid, &op, null_yield);
-  if (r == -ECANCELED) {
-    r = 0;
-  }
   if (r < 0) {
     ldpp_dout(dpp, 0) << "ERROR: could not apply olh update, r=" << r << dendl;
     return r;
@@ -7680,6 +7677,12 @@ int RGWRados::follow_olh(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_in
 
     int ret = update_olh(dpp, state, bucket_info, olh_obj);
     if (ret < 0) {
+      if (ret == -ECANCELED) {
+        // In this context, ECANCELED means that the OLH tag changed in either the bucket index entry or the OLH object.
+        // If the OLH tag changed, it indicates that a previous OLH entry was removed since this request started. We
+        // return ENOENT to indicate that the OLH object was removed.
+        ret = -ENOENT;
+      }
       return ret;
     }
   }