From: Casey Bodley Date: Thu, 2 Apr 2026 16:15:51 +0000 (-0400) Subject: rgw: CompleteMultipartUpload can fail with 404 NoSuchUpload X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8d2b1ac686c0c7be89c39810eb00a1566f30b280;p=ceph.git rgw: CompleteMultipartUpload can fail with 404 NoSuchUpload prior work in 324c377849a5d246f689f6e7a2862f42f1504d2c made the request idempotent in cases where ENOENT indicated the upload had already completed, but other ENOENT cases still returned 500. fall back to 404 NoSuchUpload here instead Fixes: https://tracker.ceph.com/issues/75534 Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index bd3cfe2a4e2d..b88752f3fce7 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -7436,13 +7436,22 @@ void RGWCompleteMultipart::execute(optional_yield y) serializer = meta_obj->get_serializer(this, y, "RGWCompleteMultipart"); op_ret = serializer->try_lock(this, dur, y); - if (op_ret < 0) { - ldpp_dout(this, 0) << "failed to acquire lock" << dendl; - if (op_ret == -ENOENT && check_previously_completed(parts)) { - ldpp_dout(this, 1) << "NOTICE: This multipart completion is already completed" << dendl; + if (op_ret == -ENOENT) { + // CompleteMultipartUpload should be idempotent - return success if the + // upload already completed. but note that this check isn't reliable in + // cases where the upload completed successfully but was later overwritten + // or deleted + if (check_previously_completed(parts)) { + ldpp_dout(this, 4) << "NOTICE: This multipart completion is already completed" << dendl; op_ret = 0; return; } + s->err.message = "The specified multipart upload does not exist."; + op_ret = -ERR_NO_SUCH_UPLOAD; + return; + } + if (op_ret < 0) { + ldpp_dout(this, 0) << "failed to acquire lock" << dendl; op_ret = -ERR_INTERNAL_ERROR; s->err.message = "This multipart completion is already in progress"; return;