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


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -430,16 +446,19 @@ Response handleGetRequest(ObjectRequestContext context, 
String keyPath)
         };
 
         responseBuilder = Response.ok(output)
-            .header(HttpHeaders.CONTENT_LENGTH, keyDetails.getDataSize());
+            .header(HttpHeaders.CONTENT_LENGTH, 
responseKeyDetails.getDataSize());
 
       } else {
         long startOffset = rangeHeader.getStartOffset();
         long endOffset = rangeHeader.getEndOffset();
         long copyLength = endOffset - startOffset + 1;
+        OzoneKeyDetails rangedKeyDetails = getClientProtocol()
+            .getS3KeyDetails(bucketName, keyPath, partNumber, startOffset,
+                endOffset);

Review Comment:
   This is a correctness issue, we should not call getS3KeyDetails multiple 
times within a single S3 call since the latter getS3KeyDetails might not return 
the same key as the first (i.e. there is a key overwrite in between).
   
   The issue is that we need to move the range check to OM side.
   
   Addressing this.



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