mladjan-gadzic commented on code in PR #4448:
URL: https://github.com/apache/ozone/pull/4448#discussion_r1159451193


##########
hadoop-ozone/dist/src/main/smoketest/s3/objectputget.robot:
##########
@@ -151,14 +151,34 @@ Incorrect values for end and start offset
                                 Should Be Equal            ${expectedData}     
       ${actualData}
 
 Zero byte file
-    ${result} =                 Execute AWSS3APICli and checkrc        
get-object --bucket ${BUCKET} --key ${PREFIX}/putobject/key=value/zerobyte 
--range bytes=0-0 /tmp/testfile2.result   255
-                                Should contain             ${result}        
InvalidRange
-
-    ${result} =                 Execute AWSS3APICli and checkrc        
get-object --bucket ${BUCKET} --key ${PREFIX}/putobject/key=value/zerobyte 
--range bytes=0-1 /tmp/testfile2.result   255
-                                Should contain             ${result}        
InvalidRange
-
-    ${result} =                 Execute AWSS3APICli and checkrc        
get-object --bucket ${BUCKET} --key ${PREFIX}/putobject/key=value/zerobyte 
--range bytes=0-10000 /tmp/testfile2.result   255
-                                Should contain             ${result}        
InvalidRange
+    ${result} =                                Execute                    
ozone sh bucket info /s3v/${BUCKET}
+    ${linked} =                        Execute                                
echo '${result}' | jq -j '.sourceVolume,"/",.sourceBucket'
+    ${eval} =                          Evaluate                               
"source" in """${linked}"""
+                                       IF      ${eval} == ${True}
+    ${result} =                 Execute                                       
ozone sh bucket info ${linked}
+                                               END
+    ${fsolayout} =                 Evaluate                           
"OPTIMIZED" in """${result}"""
+
+    ${result} =                 Execute AWSS3APICli and checkrc     get-object 
--bucket ${BUCKET} --key ${PREFIX}/putobject/key=value/zerobyte --range 
bytes=0-0 /tmp/testfile2.result   255
+                                       IF      ${fsolayout} == ${True}
+                                Should contain              ${result}       
NoSuchKey
+                                               ELSE
+                                Should contain              ${result}       
InvalidRange
+                                               END

Review Comment:
   > This might be happening because all zero byte objects are created as 
directories in FSO bucket. 
   
   This is a different issue. It has to do with what s3A expects as a response 
and what s3G returns. 
   
   > Would it make sense to also make sure that `put-object --key 
f1/zero`(without trailing /) creates a file and `put-object --key 
f1/zero/`(with trailing /) creates a directory in FSO bucket?
   
   This could be an idea for additional guard for dir creation. However, I am 
not sure if it is necessarry because there is already a flag 
`OZONE_S3G_FSO_DIRECTORY_CREATION_ENABLED` for that. I'd say, right now there 
is enough room for someone to decide whether a dir or a file should be created 
(based on 
[checks](https://github.com/apache/ozone/blob/master/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java#L216)).
   
   Does this make sense?



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