[ 
https://issues.apache.org/jira/browse/HADOOP-13221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15307667#comment-15307667
 ] 

Steve Loughran commented on HADOOP-13221:
-----------------------------------------

HADOOP-12667 adds a createNonRecursive operation (and test), which fails if the 
parent isn' there. The S3a create code could support this option too; albeit 
with a check for the parent existing as a directory, not a file. the current 
create() code would have to b factored out into something which both create() 
and createNonRecursive could call, the startup check being slightly different.

Notable that the {{createNonRecursive()}}, because it explicitly only checks 
the parent dir, is guaranteed to be O(1); with 1..3 HTTP requests made of S3 to 
guarantee that the parent dir exists and is a directory

> s3a create() doesn't check for a parent path being a file
> ---------------------------------------------------------
>
>                 Key: HADOOP-13221
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13221
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs/s3
>    Affects Versions: 2.7.2
>            Reporter: Steve Loughran
>            Assignee: Rajesh Balamohan
>
> Seen in a code review. Notable that if true, this got by all the FS contract 
> tests —showing we missed a couple.
> {{S3AFilesystem.create()}} does not examine its parent paths to verify that 
> there does not exist one which is a file. It looks for the destination path 
> if overwrite=false (see HADOOP-13188 for issues there), but it doesn't check 
> the parent for not being a file, or the parent of that path.
> It must go up the tree, verifying that either a path does not exist, or that 
> the path is a directory. The scan can stop at the first entry which is is a 
> directory, thus the operation is O(empty-directories) and not O(directories).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to