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

Chris Nauroth updated HADOOP-12977:
-----------------------------------
    Attachment: HADOOP-12977-branch-2-006.patch

Steve, thank you for patch 005.  This looks good to me.  I verified that all 
subclasses of {{AbstractContractRootDirectoryTest}} are passing and all tests 
in hadoop-aws are passing.

I'm attaching revision 006 with trivial changes to implement Mingliang's 
suggestion of using {{System.lineSeparator()}} instead of {{'\n'}} and cleaning 
up a whitespace warning.

I am +1 for revision 006 on branch-2.  This will not apply to trunk or 
branch-2.8 though, so we'd need separate patch files for those.

I did see {{TestSwiftContractRootDir#testRmNonEmptyRootDirNonRecursive}} fail 
one time on the new {{assertIsFile}} call.  (See below.)  I re-ran the test 
many times and it did not repro.  I'm going to write this off as me doing 
something wrong or possibly eventual consistency.

{code}
Running org.apache.hadoop.fs.swift.contract.TestSwiftContractRootDir
Tests run: 9, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 55.525 sec <<< 
FAILURE! - in org.apache.hadoop.fs.swift.contract.TestSwiftContractRootDir
testRmNonEmptyRootDirNonRecursive(org.apache.hadoop.fs.swift.contract.TestSwiftContractRootDir)
  Time elapsed: 5.685 sec  <<< FAILURE!
java.lang.AssertionError: File claims to be a directory 
/testRmNonEmptyRootDirNonRecursive  SwiftFileStatus{ 
path=swift://cnauroth-test-swift.rackspace/testRmNonEmptyRootDirNonRecursive; 
isDirectory=true; length=0; blocksize=33554432; modification_time=1475779099000}
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.assertTrue(Assert.java:41)
        at org.junit.Assert.assertFalse(Assert.java:64)
        at 
org.apache.hadoop.fs.contract.ContractTestUtils.assertIsFile(ContractTestUtils.java:699)
        at 
org.apache.hadoop.fs.contract.ContractTestUtils.assertIsFile(ContractTestUtils.java:688)
        at 
org.apache.hadoop.fs.contract.AbstractFSContractTestBase.assertIsFile(AbstractFSContractTestBase.java:316)
        at 
org.apache.hadoop.fs.contract.AbstractContractRootDirectoryTest.testRmNonEmptyRootDirNonRecursive(AbstractContractRootDirectoryTest.java:121)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
        at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
        at 
org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)
{code}


> s3a to handle delete("/", true) robustly
> ----------------------------------------
>
>                 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
>            Assignee: Steve Loughran
>            Priority: Minor
>         Attachments: HADOOP-12977-001.patch, HADOOP-12977-002.patch, 
> HADOOP-12977-branch-2-002.patch, HADOOP-12977-branch-2-002.patch, 
> HADOOP-12977-branch-2-003.patch, HADOOP-12977-branch-2-004.patch, 
> HADOOP-12977-branch-2-005.patch, HADOOP-12977-branch-2-006.patch
>
>
> 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