From 01982c894386dd4430f99e453d92f9241cb18e9e Mon Sep 17 00:00:00 2001 From: Cory Snyder Date: Mon, 25 Jul 2022 16:04:09 -0400 Subject: [PATCH] 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 --- src/rgw/rgw_rados.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 2bbec2b1fbdf3..620a406678873 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; } } -- 2.39.5