You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "YutaLin (via GitHub)" <gi...@apache.org> on 2026/05/07 00:00:57 UTC

[PR] HDDS-13921. Conditional Copy (CopyObject) [ozone]

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

   ## What changes were proposed in this pull request?
   support CopyObject conditions include
   
   - x-amz-copy-source-if-match: - Copy only if source ETag matches
   - x-amz-copy-source-if-none-match: - Copy only if source ETag doesn't match
   - x-amz-copy-source-if-modified-since: - Copy only if source modified after
   - x-amz-copy-source-if-unmodified-since: - Copy only if source not modified since
   - If-None-Match, If-Match
   
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-13921
   
   ## How was this patch tested?
   add conditional copy object test and run action ci


-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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

   > > @YutaLin I think this patch only handle the read side condition check, but we also need dest side:
   > > > Destination Object Conditions (AWS Release 2.37.0):
   > > > If-None-Match: "*" - Copy only if destination does NOT exist Prevents unintended overwrites of destination object
   > > > Error Codes: 412 Precondition Failed - When any condition is not met
   > 
   > Hi @peterxcli, the conditional read side check is `ObjectEndPoint` #copyObject -> writeConditions is passed to the #copy-> #openKeyForPut is called with writeConditions -> #openKeyForPut applies If-None-Match, If-Match
   > 
   > Let me know if I miss anything, thanks!
   
   thanks for explanation, then I think only thing remain is the test coverage for them.
   
   I saw the copy request builder has following we should use the cover the write part in sdk v2:
   ```java
   public final String ifMatch() {
     return this.ifMatch;
   }
   
   public final String ifNoneMatch() {
     return this.ifNoneMatch;
   }
   ```
   
   v1 also need


-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3ConditionalRequest.java:
##########
@@ -45,80 +45,92 @@ final class S3ConditionalRequest {
   private S3ConditionalRequest() {
   }
 
-  static Response evaluateReadPreconditions(HttpHeaders headers,
-      String keyPath, OzoneKey key) throws OS3Exception {
+  /**
+   * Context for evaluating preconditions, defining which headers to check
+   * and how to handle cache validation scenarios.
+   */
+  enum PreconditionContext {

Review Comment:
   All write operations use the same headers and have the same behavior:
     - If-None-Match: * → create only if key doesn't exist
     - If-Match: <etag> → overwrite only if ETag matches
     - Both throw 412 on failure



-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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

   > thanks for explanation, then I think only thing remain is the test coverage for them.
   > 
   > I saw the copy request builder has following we should use the cover the write part in sdk v2:
   > 
   > ```java
   > public final String ifMatch() {
   >   return this.ifMatch;
   > }
   > 
   > public final String ifNoneMatch() {
   >   return this.ifNoneMatch;
   > }
   > ```
   > 
   > v1 also need
   
   Hi @peterxcli
   I've add tests in sdkv2. I don't add it in v1 because it doesn't support destination conditions for CopyObject. Only v2 has ifMatch/IfNoneMatch method.
   sources:
   https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/model/CopyObjectRequest.html
   
   CI: https://github.com/YutaLin/ozone/actions/runs/25591732427


-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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

   Hi @ivandika3, @peterxcli
   Could you help me review it? appreciate!


-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3ConditionalRequest.java:
##########
@@ -79,6 +79,46 @@ static Response evaluateReadPreconditions(HttpHeaders headers,
     return null;
   }
 
+  /**
+   * Evaluates copy source preconditions for CopyObject operation.
+   * Checks x-amz-copy-source-if-match, x-amz-copy-source-if-none-match,
+   * x-amz-copy-source-if-modified-since, x-amz-copy-source-if-unmodified-since.
+   *
+   * @param headers HTTP headers containing the conditional headers
+   * @param sourceKeyPath path of the source key for error messages
+   * @param sourceKey the source key metadata
+   * @throws OS3Exception with 412 Precondition Failed if conditions are not met
+   */
+  static void evaluateCopySourcePreconditions(HttpHeaders headers,

Review Comment:
   could you try to reuse the `evaluateReadPreconditions`?



-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3ConditionalRequest.java:
##########
@@ -45,80 +45,92 @@ final class S3ConditionalRequest {
   private S3ConditionalRequest() {
   }
 
-  static Response evaluateReadPreconditions(HttpHeaders headers,
-      String keyPath, OzoneKey key) throws OS3Exception {
+  /**
+   * Context for evaluating preconditions, defining which headers to check
+   * and how to handle cache validation scenarios.
+   */
+  enum PreconditionContext {

Review Comment:
   Could you please elaborate? which of their behaviour is the same? Thanks!



-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3ConditionalRequest.java:
##########
@@ -45,80 +45,92 @@ final class S3ConditionalRequest {
   private S3ConditionalRequest() {
   }
 
-  static Response evaluateReadPreconditions(HttpHeaders headers,
-      String keyPath, OzoneKey key) throws OS3Exception {
+  /**
+   * Context for evaluating preconditions, defining which headers to check
+   * and how to handle cache validation scenarios.
+   */
+  enum PreconditionContext {

Review Comment:
   ok, fine, let's think it later



-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3ConditionalRequest.java:
##########
@@ -45,80 +45,92 @@ final class S3ConditionalRequest {
   private S3ConditionalRequest() {
   }
 
-  static Response evaluateReadPreconditions(HttpHeaders headers,
-      String keyPath, OzoneKey key) throws OS3Exception {
+  /**
+   * Context for evaluating preconditions, defining which headers to check
+   * and how to handle cache validation scenarios.
+   */
+  enum PreconditionContext {

Review Comment:
   how about also add write in here?



-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3ConditionalRequest.java:
##########
@@ -45,80 +45,92 @@ final class S3ConditionalRequest {
   private S3ConditionalRequest() {
   }
 
-  static Response evaluateReadPreconditions(HttpHeaders headers,
-      String keyPath, OzoneKey key) throws OS3Exception {
+  /**
+   * Context for evaluating preconditions, defining which headers to check
+   * and how to handle cache validation scenarios.
+   */
+  enum PreconditionContext {

Review Comment:
   oh, I got your point, write header are always the same, this class is only for distinguishing the copy/read request header(they have same suffix)
   However the `PreconditionContext` name is too generic, let's rename it to sth like ReadCondition.



-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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

   > I don't add it in v1 because it doesn't support destination conditions for CopyObject. Only v2 has ifMatch/IfNoneMatch method.
   
   - https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/model/CopyObjectRequest.html#setMatchingETagConstraints-java.util.List-
   - https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/model/CopyObjectRequest.html#setNonmatchingETagConstraints-java.util.List-


-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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

   > * https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/model/CopyObjectRequest.html#setMatchingETagConstraints-java.util.List-
   > * https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/model/CopyObjectRequest.html#setNonmatchingETagConstraints-java.util.List-
   
   Hi @peterxcli, thanks for the feedback
   `getMatchingETagConstraints`, `setMatchingETagConstraints` are already used for source object's ETag test.
   see #setMatchingETagConstraints, #testCopyObjectWithSourceIfMatchFail, #testCopyObjectWithSourceIfNoneMatch and #testCopyObjectWithSourceIfNoneMatchFail
   


-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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

   Hi @peterxcli, thanks for the review!
   I've added S3SDKV1/V2 tests.


-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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

    > Hi @peterxcli, thanks for the feedback `getMatchingETagConstraints`, `setMatchingETagConstraints` are already used for source object's ETag test. see #setMatchingETagConstraints, #testCopyObjectWithSourceIfMatchFail, #testCopyObjectWithSourceIfNoneMatch and #testCopyObjectWithSourceIfNoneMatchFail
   
   Oh, thanks for pointing them out, sorry I missed them.


-- 
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-13921. Conditional Copy (CopyObject) [ozone]

Posted by "peterxcli (via GitHub)" <gi...@apache.org>.
peterxcli merged PR #10207:
URL: https://github.com/apache/ozone/pull/10207


-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3ConditionalRequest.java:
##########
@@ -79,6 +79,46 @@ static Response evaluateReadPreconditions(HttpHeaders headers,
     return null;
   }
 
+  /**
+   * Evaluates copy source preconditions for CopyObject operation.
+   * Checks x-amz-copy-source-if-match, x-amz-copy-source-if-none-match,
+   * x-amz-copy-source-if-modified-since, x-amz-copy-source-if-unmodified-since.
+   *
+   * @param headers HTTP headers containing the conditional headers
+   * @param sourceKeyPath path of the source key for error messages
+   * @param sourceKey the source key metadata
+   * @throws OS3Exception with 412 Precondition Failed if conditions are not met
+   */
+  static void evaluateCopySourcePreconditions(HttpHeaders headers,

Review Comment:
   I've refactor `evaluateReadPreconditions` since errors are different in read/copy resource.



-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3ConditionalRequest.java:
##########
@@ -45,80 +45,92 @@ final class S3ConditionalRequest {
   private S3ConditionalRequest() {
   }
 
-  static Response evaluateReadPreconditions(HttpHeaders headers,
-      String keyPath, OzoneKey key) throws OS3Exception {
+  /**
+   * Context for evaluating preconditions, defining which headers to check
+   * and how to handle cache validation scenarios.
+   */
+  enum PreconditionContext {

Review Comment:
   We don't need it now because IF-Match/IF-None-Match have same behavior on GET/HEAD/CopyObject.



-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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

   Thanks @peterxcli for the merge and the feedback, really appreciate! 


-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3ConditionalRequest.java:
##########
@@ -45,80 +45,92 @@ final class S3ConditionalRequest {
   private S3ConditionalRequest() {
   }
 
-  static Response evaluateReadPreconditions(HttpHeaders headers,
-      String keyPath, OzoneKey key) throws OS3Exception {
+  /**
+   * Context for evaluating preconditions, defining which headers to check
+   * and how to handle cache validation scenarios.
+   */
+  enum PreconditionContext {

Review Comment:
   It would be S3ConditionalRequest.ReadCondition.COPY_SOURCE when we rename it ReadCondition, then it sounds like copy is a type of "read condition". I'd suggest keeping the current name. 



-- 
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-13921. Conditional Copy (CopyObject) [ozone]

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

   > @YutaLin I think this patch only handle the read side condition check, but we also need dest side:
   > 
   > > Destination Object Conditions (AWS Release 2.37.0):
   > > If-None-Match: "*" - Copy only if destination does NOT exist Prevents unintended overwrites of destination object
   > > Error Codes: 412 Precondition Failed - When any condition is not met
   
   Hi @peterxcli, the conditional read side check is
   `ObjectEndPoint` #copyObject -> writeConditions is passed to the #copy-> #openKeyForPut is called with writeConditions -> #openKeyForPut applies If-None-Match, If-Match
   
   Let me know if I miss anything, thanks!


-- 
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