YutaLin commented on code in PR #10164:
URL: https://github.com/apache/ozone/pull/10164#discussion_r3173351891


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadCompleteRequest.java:
##########
@@ -269,6 +269,16 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager, Execut
             OMException.ResultCodes.NO_SUCH_MULTIPART_UPLOAD_ERROR);
       }
 
+      // Conditional write validation for If-None-Match / If-Match headers
+      // Load existing committed key to check preconditions
+      OmKeyInfo existingKeyInfo = 
omMetadataManager.getKeyTable(getBucketLayout()).get(dbOzoneKey);
+
+      // Validate If-None-Match: * (create-if-absent) or generation match
+      validateAtomicRewrite(existingKeyInfo, keyArgs);
+
+      // Convert If-Match ETag to expectedDataGeneration for atomic validation
+      keyArgs = validateAndRewriteIfMatchAsExpectedGeneration(keyArgs, 
existingKeyInfo);

Review Comment:
   You're right! I just reuse it, but mpu doesn't need the rewrite, i will add 
a simple method.



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

Reply via email to