Skip to content

HDDS-15638. Conditional DeleteObjects#10572

Open
amaliujia wants to merge 2 commits into
apache:masterfrom
amaliujia:conditional_deleteObjects
Open

HDDS-15638. Conditional DeleteObjects#10572
amaliujia wants to merge 2 commits into
apache:masterfrom
amaliujia:conditional_deleteObjects

Conversation

@amaliujia

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This change adds support for conditional DeleteObjects in the Ozone S3 Gateway, aligned with the AWS S3 DeleteObjects API for general purpose buckets.

Clients can include an optional element per object in the DeleteObjects XML body. The gateway deletes an object only when its current ETag matches the provided value. If the precondition fails, the per-object response includes a PreconditionFailed error instead of deleting the object.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15638

How was this patch tested?

Unit Test

@amaliujia

Copy link
Copy Markdown
Contributor Author

@peterxcli trying to help on this effort.

@peterxcli

Copy link
Copy Markdown
Member

Thanks, will take a look. You can also review the conditional delete patch

#10511

@peterxcli

Copy link
Copy Markdown
Member

And actually I have a draft blog for conditional request.

https://docs.google.com/document/d/1DwDKx5G90Vo_E9MES_OI_PegVwfbiI94_ysmT1iEszE/edit?usp=drivesdk

Feel free to leave some comments or request to edit.

@peterxcli peterxcli self-requested a review June 22, 2026 09:59
Comment on lines +199 to 203
static boolean matchesETag(String headerValue, String currentETag) {
return eTagMatches(headerValue, currentETag);
}

private static boolean eTagMatches(String headerValue, String currentETag) {

@peterxcli peterxcli Jun 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's just expose the existing func.

Suggested change
static boolean matchesETag(String headerValue, String currentETag) {
return eTagMatches(headerValue, currentETag);
}
private static boolean eTagMatches(String headerValue, String currentETag) {
static boolean eTagMatches(String headerValue, String currentETag) {

return result;
}

private void deleteSingleObject(OzoneBucket bucket, DeleteObject deleteObject,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be in server side, but I not sure how can we bring a map or a list of expected etags in proto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants