[ 
https://issues.apache.org/jira/browse/HADOOP-19350?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chung En Lee updated HADOOP-19350:
----------------------------------
    Description: 
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

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

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 goes to step 4
 ** 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]
 # put test/testOverwriteNonEmptyDirector

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. 

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

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

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. 


> 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
>            Priority: Minor
>
> 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
> Both of these tests expect to throw a FileAlreadyExistsException, while 
> creating a file that overwrites an existing directory.
> 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 goes to step 4
>  ** 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]
>  # put test/testOverwriteNonEmptyDirector
> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to