From: Cory Snyder Date: Mon, 25 Jul 2022 20:04:09 +0000 (-0400) Subject: rgw: optimizations for handling ECANCELED errors within get_obj_state X-Git-Tag: v18.0.0~384^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F47187%2Fhead;p=ceph.git rgw: optimizations for handling ECANCELED errors within get_obj_state These optimizations for handling ECANCELED errors should prevent some needless RADOS queries upstream. Signed-off-by: Cory Snyder --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 2bbec2b1fbdf..620a40667887 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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; } }