Chung En Lee created HADOOP-19350:
-------------------------------------

             Summary: ITestS3AContractCreate#testOverwrite*EmptyDirectory fail
                 Key: HADOOP-19350
                 URL: https://issues.apache.org/jira/browse/HADOOP-19350
             Project: Hadoop Common
          Issue Type: Bug
    Affects Versions: 3.4.1
            Reporter: Chung En Lee


See [https://github.com/apache/hadoop/pull/6168#issuecomment-1756082091] 
They also fail with Apache Ozone. See 
https://issues.apache.org/jira/browse/HDDS-11663

While creating a file that overwrites an existing directory, both of these 
tests expect to throw a FileAlreadyExistsException. 

The following is a step-by-step description of the test.

 # mkdir test/testOverwriteNonEmptyDirectory/         // existing directory

 # get test/testOverwriteNonEmptyDirector                // start to create 
file to overwrite directory
 # check the file status of test/testOverwriteNonEmptyDirector
 ** If it throws FileNotFound then continue
 ** check if it is a directory then throw FileAlreadyExistsException    // 
expect to throw 
[here|https://github.com/apache/hadoop/blob/trunk/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java#L2196-L2199]
 ** check if the overwrite is false then throw FileAlreadyExistsException    // 
[here|https://github.com/apache/hadoop/blob/trunk/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java#L2200-L2203]

 # If nothing goes wrong then create the file.

However, in step 3 it jumps to the first check, while creating a file.

S3a is expecting:

Get test/testOverwriteNonEmptyDirector    // does not exist
Get test/testOverwriteNonEmptyDirector/   // exists

Therefore, the test will never go to the second check, and it will still throw 
an exception but, not FileAlreadyExistsException when creating a file. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-dev-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-dev-h...@hadoop.apache.org

Reply via email to