You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Steve Loughran (Jira)" <ji...@apache.org> on 2020/08/10 19:04:00 UTC

[jira] [Created] (HADOOP-17200) Renaming a file under a sibling empty directory doesn't delete dest dir's marker

Steve Loughran created HADOOP-17200:
---------------------------------------

             Summary: 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.1.3, 3.2.1, 3.3.0
            Reporter: Steve Loughran
            Assignee: Steve Loughran


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-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org