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

Steve Loughran commented on HADOOP-12977:
-----------------------------------------

... The root directory test {{testRmRootRecursive()}} allows for the operation 
to return false, meaning "the root dir wasn't deleted"; 

Looking at the fs spect. it says

bq. The POSIX model assumes that if the user has the correct permissions to 
delete everything, they are free to do so (resulting in an empty filesystem).
{code}
    if isDir(FS, p) and isRoot(p) and recursive :
        FS' = ({["/"]}, {}, {}, {})
        result = True
{code}

bq. In contrast, HDFS never permits the deletion of the root of a filesystem; 
the filesystem can be taken offline and reformatted if an empty filesystem is 
desired.
{code}
    if isDir(FS, p) and isRoot(p) and recursive :
        FS' = FS
        result = False
{code}

So: the s3a logic follows that of HDFS: you can't do {{rm -rf /}}. Yet unlike 
HDFS, you can't take the fs offline and do a delete. 

# we need to decide what to do
# the contract tests should require the filesystem to declare what they do, 
follow HDFS or Posix

> s3a ignores delete("/", true)
> -----------------------------
>
>                 Key: HADOOP-12977
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12977
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs/s3
>    Affects Versions: 2.9.0
>            Reporter: Steve Loughran
>            Priority: Minor
>
> if you try to delete the root directory on s3a, you get politely but firmly 
> told you can't
> {code}
> 2016-03-30 12:01:44,924 INFO  s3a.S3AFileSystem 
> (S3AFileSystem.java:delete(638)) - s3a cannot delete the root directory
> {code}
> The semantics of {{rm -rf "/"}} are defined, they are "delete everything 
> underneath, while preserving the root dir itself".
> # s3a needs to support this.
> # this skipped through the FS contract tests in 
> {{AbstractContractRootDirectoryTest}}; the option of whether deleting / works 
> or not should be made configurable.



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