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

Steve Loughran resolved HADOOP-17200.
-------------------------------------
    Resolution: Duplicate

> Renaming a file under a sibling empty directory doesn't delete dest dir's 
> marker
> --------------------------------------------------------------------------------
>
>                 Key: HADOOP-17200
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17200
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs/s3
>    Affects Versions: 3.3.0, 3.2.1, 3.1.3
>            Reporter: Steve Loughran
>            Assignee: Steve Loughran
>            Priority: Major
>
> This has probably existed for a long time -the fact that nobody has noticed 
> is probably just luck.
> Probably came with the *fix* of HADOOP-15079.
> Given 
> * a base directory /base
> * A file /base/file
> * an empty directory /base/empty (with empty dir marker)
> * if you rename base/file under base/empty (key: with the dir passed in, not 
> the full filename) the file is moved, but the marker /base/empty/ is not
> The issue is that the  delete/recreate markers compares src and dest parent 
> for equivalence when skipping marker delete, but if the final path of the 
> rename is *under* the path "dst" then the comparison is wrong -it must be on 
> the parent of the final path, not the path handed to rename()
> {code}
>     if (!src.getParent().equals(dst.getParent())) {
>       LOG.debug("source & dest parents are different; fix up dir markers");
>       deleteUnnecessaryFakeDirectories(dst.getParent());
>       maybeCreateFakeParentDirectory(src);
>     }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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