ivandika3 commented on code in PR #9815:
URL: https://github.com/apache/ozone/pull/9815#discussion_r3019841629


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -281,21 +299,24 @@ Response handlePutRequest(ObjectRequestContext context, 
String keyPath, InputStr
           getCustomMetadataFromHeaders(getHeaders().getRequestHeaders());
       Map<String, String> tags = getTaggingFromHeaders(getHeaders());
 
+      boolean hasConditionalHeaders = ifNoneMatch != null || ifMatch != null;
       long putLength;
       final String md5Hash;
-      if (isDatastreamEnabled() && !enableEC && length > 
getDatastreamMinLength()) {
+      if (isDatastreamEnabled() && !enableEC
+          && length > getDatastreamMinLength() && !hasConditionalHeaders) {
         perf.appendStreamMode();
         Pair<String, Long> keyWriteResult = ObjectEndpointStreaming
             .put(bucket, keyPath, length, replicationConfig, getChunkSize(),
-                customMetadata, tags, multiDigestInputStream, getHeaders(), 
signatureInfo.isSignPayload(), perf);
+                customMetadata, tags, multiDigestInputStream, getHeaders(),
+                signatureInfo.isSignPayload(), perf);

Review Comment:
   PutObject using streaming write should be able to handle conditional request 
since the OpenKey and CommitKey metadata operations are the same as the 
non-streaming put (only data operations are different).
   
   We can then remove the `hasConditionalHeaders` boolean.



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