From: lu.shasha Date: Fri, 6 Dec 2024 04:40:27 +0000 (+0800) Subject: rgw: shouldn't call index_op.cancel() when rados op return ETIMEDOUT X-Git-Tag: testing/wip-khiremat-testing-20250422.120708-squid-debug~70^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=f884b591631db9af58173ba118b35b3e0d8392f8;p=ceph-ci.git rgw: shouldn't call index_op.cancel() when rados op return ETIMEDOUT when rados op return ETIMEOUT, rgw can't determine whether or not the rados op succeeded, we shouldn't be calling index_op->cancel() in this case Instead, we should leave that pending entry in the index so than bucket listing can recover with check_disk_state() and cls_rgw_suggest_changes() Signed-off-by: Shasha Lu (cherry picked from commit 0c578a127e30a372da33ea52df3b1c2654178020) --- diff --git a/src/rgw/driver/rados/rgw_rados.cc b/src/rgw/driver/rados/rgw_rados.cc index e93ee1e83a2..a0e0292bf0b 100644 --- a/src/rgw/driver/rados/rgw_rados.cc +++ b/src/rgw/driver/rados/rgw_rados.cc @@ -3317,12 +3317,17 @@ int RGWRados::Object::Write::_do_write_meta(uint64_t size, uint64_t accounted_si return 0; done_cancel: - int ret = index_op->cancel(rctx.dpp, meta.remove_objs, rctx.y, log_op); - if (ret < 0) { - ldpp_dout(rctx.dpp, 0) << "ERROR: index_op.cancel() returned ret=" << ret << dendl; - } + // if r == -ETIMEDOUT, rgw can't determine whether or not the rados op succeeded + // we shouldn't be calling index_op->cancel() in this case + // Instead, we should leave that pending entry in the index so than bucket listing can recover with check_disk_state() and cls_rgw_suggest_changes() + if (r != -ETIMEDOUT) { + int ret = index_op->cancel(rctx.dpp, meta.remove_objs, rctx.y, log_op); + if (ret < 0) { + ldpp_dout(rctx.dpp, 0) << "ERROR: index_op.cancel() returned ret=" << ret << dendl; + } - meta.canceled = true; + meta.canceled = true; + } /* we lost in a race. There are a few options: * - existing object was rewritten (ECANCELED)