kerneltime opened a new pull request, #11859: URL: https://github.com/apache/ozone/pull/11859
## What changes were proposed in this pull request? An S3 `DELETE` on an object key means one of two things: `DELETE /bucket/key?uploadId=<id>` aborts a multipart upload, and `DELETE /bucket/key` deletes the object. When `uploadId` is present but empty, the S3 Gateway treated it as absent and deleted the committed object. The request names an abort, so the client asked for no data to be removed, but the object is gone. `MultipartKeyHandler#handleDeleteRequest` let the next handler run when `StringUtils.isEmpty(uploadId)`, and the chain reached the plain key delete in `ObjectEndpoint#handleDeleteRequest`. The GET path in the same class already checks only for `null`. This change treats only a missing `uploadId` as "not a multipart request". An empty `uploadId` names no upload, so the request fails with `NoSuchUpload`, recorded as a failed AbortMultipartUpload, and the key is left untouched. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-17599 ## How was this patch tested? - Unit: `TestObjectDelete#testDeleteWithEmptyUploadIdKeepsKey` puts a key, sends DELETE with an empty `uploadId`, and checks `NoSuchUpload` and that the key still exists. It fails without the fix, because the key is deleted. - Acceptance: a new case in `s3/objectdelete.robot` does the same through a presigned AbortMultipartUpload URL, because the AWS CLI rejects an empty upload ID; `presigned_url_helper.py` gains the helper. On the `ozone` compose cluster it fails on master (the DELETE returns `204 No Content` and the object is gone) and passes with the fix. The other `objectdelete.robot` cases pass in both runs. - `checkstyle:check` on `ozone-s3gateway` is clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
