You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "amaliujia (via GitHub)" <gi...@apache.org> on 2026/06/22 09:34:14 UTC

[PR] HDDS-15638. Conditional DeleteObjects [ozone]

amaliujia opened a new pull request, #10572:
URL: https://github.com/apache/ozone/pull/10572

   ## 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](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html) for general purpose buckets.
   
   Clients can include an optional <ETag> 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
   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15638. Conditional DeleteObjects [ozone]

Posted by "peterxcli (via GitHub)" <gi...@apache.org>.
peterxcli commented on PR #10572:
URL: https://github.com/apache/ozone/pull/10572#issuecomment-4767081743

   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.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15638. Conditional DeleteObjects [ozone]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10572:
URL: https://github.com/apache/ozone/pull/10572#issuecomment-5008744802

   This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15638. Conditional DeleteObjects [ozone]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10572:
URL: https://github.com/apache/ozone/pull/10572#issuecomment-5075802547

   Thank you for your contribution. This PR is being closed due to inactivity. Please contact a maintainer if you would like to reopen it.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15638. Conditional DeleteObjects [ozone]

Posted by "amaliujia (via GitHub)" <gi...@apache.org>.
amaliujia commented on code in PR #10572:
URL: https://github.com/apache/ozone/pull/10572#discussion_r3479412710


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3ConditionalRequest.java:
##########
@@ -196,6 +196,10 @@ private static Response buildNotModifiedResponse(OzoneKey key) {
     return responseBuilder.build();
   }
 
+  static boolean matchesETag(String headerValue, String currentETag) {
+    return eTagMatches(headerValue, currentETag);
+  }
+
   private static boolean eTagMatches(String headerValue, String currentETag) {

Review Comment:
   done



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15638. Conditional DeleteObjects [ozone]

Posted by "peterxcli (via GitHub)" <gi...@apache.org>.
peterxcli commented on code in PR #10572:
URL: https://github.com/apache/ozone/pull/10572#discussion_r3466175986


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3ConditionalRequest.java:
##########
@@ -196,6 +196,10 @@ private static Response buildNotModifiedResponse(OzoneKey key) {
     return responseBuilder.build();
   }
 
+  static boolean matchesETag(String headerValue, String currentETag) {
+    return eTagMatches(headerValue, currentETag);
+  }
+
   private static boolean eTagMatches(String headerValue, String currentETag) {

Review Comment:
   let's just expose the existing func.
   ```suggestion
     static boolean eTagMatches(String headerValue, String currentETag) {
   ```



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15638. Conditional DeleteObjects [ozone]

Posted by "peterxcli (via GitHub)" <gi...@apache.org>.
peterxcli commented on code in PR #10572:
URL: https://github.com/apache/ozone/pull/10572#discussion_r3466201530


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -393,6 +405,48 @@ public MultiDeleteResponse multiDelete(
     return result;
   }
 
+  private void deleteSingleObject(OzoneBucket bucket, DeleteObject deleteObject,

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



##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3ConditionalRequest.java:
##########
@@ -196,6 +196,10 @@ private static Response buildNotModifiedResponse(OzoneKey key) {
     return responseBuilder.build();
   }
 
+  static boolean matchesETag(String headerValue, String currentETag) {
+    return eTagMatches(headerValue, currentETag);
+  }
+
   private static boolean eTagMatches(String headerValue, String currentETag) {

Review Comment:
   ```suggestion
     static boolean eTagMatches(String headerValue, String currentETag) {
   ```



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15638. Conditional DeleteObjects [ozone]

Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang commented on code in PR #10572:
URL: https://github.com/apache/ozone/pull/10572#discussion_r4116757631


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3ConditionalRequest.java:
##########
@@ -207,7 +207,7 @@ private static Response buildNotModifiedResponse(OzoneKey key) {
     return responseBuilder.build();
   }
 
-  private static boolean eTagMatches(String headerValue, String currentETag) {
+  public static boolean eTagMatches(String headerValue, String currentETag) {

Review Comment:
   ```suggestion
     /**
      * Checks whether the supplied ETag header value matches the current object ETag.
      * <p>
      * The header may contain a comma-separated list of ETags, and the special
      * wildcard value {@code *} matches any current ETag.
      * </p>
      *
      * @param headerValue the raw value from the conditional request header
      * @param currentETag the current object's ETag
      * @return {@code true} if any candidate ETag matches or the wildcard is present;
      *         {@code false} otherwise
      */
     public static boolean eTagMatches(String headerValue, String currentETag) {
   ```



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15638. Conditional DeleteObjects [ozone]

Posted by "amaliujia (via GitHub)" <gi...@apache.org>.
amaliujia commented on code in PR #10572:
URL: https://github.com/apache/ozone/pull/10572#discussion_r3479411324


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -393,6 +405,48 @@ public MultiDeleteResponse multiDelete(
     return result;
   }
 
+  private void deleteSingleObject(OzoneBucket bucket, DeleteObject deleteObject,

Review Comment:
   You mean OM side?



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15638. Conditional DeleteObjects [ozone]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10572:
URL: https://github.com/apache/ozone/pull/10572#issuecomment-6456822635

   Thank you for your contribution. This PR is being closed due to inactivity. Please contact a maintainer if you would like to reopen it.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15638. Conditional DeleteObjects [ozone]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #10572: HDDS-15638. Conditional DeleteObjects
URL: https://github.com/apache/ozone/pull/10572


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15638. Conditional DeleteObjects [ozone]

Posted by "peterxcli (via GitHub)" <gi...@apache.org>.
peterxcli commented on PR #10572:
URL: https://github.com/apache/ozone/pull/10572#issuecomment-4767066303

   Thanks, will take a look. You can also review the conditional delete patch
   
   https://github.com/apache/ozone/pull/10511


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15638. Conditional DeleteObjects [ozone]

Posted by "peterxcli (via GitHub)" <gi...@apache.org>.
peterxcli commented on code in PR #10572:
URL: https://github.com/apache/ozone/pull/10572#discussion_r3481315847


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java:
##########
@@ -393,6 +405,48 @@ public MultiDeleteResponse multiDelete(
     return result;
   }
 
+  private void deleteSingleObject(OzoneBucket bucket, DeleteObject deleteObject,

Review Comment:
   yes



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15638. Conditional DeleteObjects [ozone]

Posted by "amaliujia (via GitHub)" <gi...@apache.org>.
amaliujia commented on PR #10572:
URL: https://github.com/apache/ozone/pull/10572#issuecomment-4766891570

   @peterxcli trying to help on this effort.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15638. Conditional DeleteObjects [ozone]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #10572: HDDS-15638. Conditional DeleteObjects
URL: https://github.com/apache/ozone/pull/10572


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15638. Conditional DeleteObjects [ozone]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10572:
URL: https://github.com/apache/ozone/pull/10572#issuecomment-6280117042

   This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org