From 472259f69ce48c458bdbb90d469cfd84556eec56 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Fri, 6 Oct 2023 09:01:06 -0400 Subject: [PATCH] rgwlc: treat persistent notify reservation as failure as fatal (Because that's consistent with what we have been doing for expiration.) This is possibly a controversial choice, and it might be better to allow setting a site policy, in future. Signed-off-by: Matt Benjamin --- src/rgw/rgw_lc.cc | 57 ++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index e4ba182b67214..b6781ce058c32 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -827,7 +827,7 @@ int RGWLC::handle_multipart_expiration(rgw::sal::Bucket* target, const auto event_type = rgw::notify::ObjectExpirationAbortMPU; std::string version_id; - auto pf = [&](RGWLC::LCWorker* wk, WorkQ* wq, WorkItem& wi) { + auto pf = [&](RGWLC::LCWorker *wk, WorkQ *wq, WorkItem &wi) { int ret{0}; auto wt = boost::get>(wi); auto& [rule, obj] = wt; @@ -845,44 +845,41 @@ int RGWLC::handle_multipart_expiration(rgw::sal::Bucket* target, ret = notify->publish_reserve(this, nullptr); if (ret < 0) { - ldpp_dout(wk->get_lc(), 0) - << "ERROR: reserving persistent notification for abort_multipart_upload, ret=" << ret - << ", thread:" << wq->thr_name() - << ", meta:" << obj.key - << dendl; + ldpp_dout(wk->get_lc(), 0) + << "ERROR: reserving persistent notification for " + "abort_multipart_upload, ret=" + << ret << ", thread:" << wq->thr_name() + << ", deferring mpu cleanup for meta:" << obj.key << dendl; + return ret; } ret = mpu->abort(this, cct, null_yield); if (ret == 0) { - ret = notify->publish_commit( - this, sal_obj->get_obj_size(), - ceph::real_clock::now(), - sal_obj->get_attrs()[RGW_ATTR_ETAG].to_str(), - version_id); - if (ret < 0) { - ldpp_dout(wk->get_lc(), 1) << - "ERROR: notify publish_commit failed, with error: " << ret << dendl; - } - if (perfcounter) { + this, sal_obj->get_obj_size(), ceph::real_clock::now(), + sal_obj->get_attrs()[RGW_ATTR_ETAG].to_str(), version_id); + if (ret < 0) { + ldpp_dout(wk->get_lc(), 1) + << "ERROR: notify publish_commit failed, with error: " << ret + << dendl; + } + if (perfcounter) { perfcounter->inc(l_rgw_lc_abort_mpu, 1); } } else { - if (ret == -ERR_NO_SUCH_UPLOAD) { - ldpp_dout(wk->get_lc(), 5) - << "ERROR: abort_multipart_upload failed, ret=" << ret - << ", thread:" << wq->thr_name() - << ", meta:" << obj.key - << dendl; - } else { - ldpp_dout(wk->get_lc(), 0) - << "ERROR: abort_multipart_upload failed, ret=" << ret - << ", thread:" << wq->thr_name() - << ", meta:" << obj.key - << dendl; - } + if (ret == -ERR_NO_SUCH_UPLOAD) { + ldpp_dout(wk->get_lc(), 5) << "ERROR: abort_multipart_upload " + "failed, ret=" + << ret << ", thread:" << wq->thr_name() + << ", meta:" << obj.key << dendl; + } else { + ldpp_dout(wk->get_lc(), 0) << "ERROR: abort_multipart_upload " + "failed, ret=" + << ret << ", thread:" << wq->thr_name() + << ", meta:" << obj.key << dendl; + } } /* abort failed */ - } /* expired */ + } /* expired */ }; worker->workpool->setf(pf); -- 2.39.5