Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-14151

Swift treats empty file as directory

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.0.0-alpha4
    • Fix Version/s: None
    • Component/s: fs/swift
    • Labels:
      None

      Description

      Unit test TestSwiftContractRootDir#testRmNonEmptyRootDirNonRecursive fails at assertIsFile(file). This leads me to suspect swift treats 0-len file as directory. Confirmed by the following experiment:

      $ ls -l /tmp/zero /tmp/abc
      -rw-rw-r--  1 jzhuge  wheel  4 Mar  7 13:19 /tmp/abc
      -rw-rw-r--  1 jzhuge  wheel  0 Mar  7 13:19 /tmp/zero
      
      $ bin/hadoop fs -put /tmp/zero /tmp/abc swift://jzswift.rackspace/
      2017-03-07 13:24:09,321 INFO snative.SwiftNativeFileSystemStore: mv  jzswift/zero._COPYING_ swift://jzswift.rackspace/zero
      
      $ bin/hadoop fs -touchz swift://jzswift.rackspace/touchz
      
      $ bin/hadoop fs -ls swift://jzswift.rackspace/
      Found 3 items
      -rw-rw-rw-   1          4 2017-03-07 13:36 swift://jzswift.rackspace/abc
      drwxrwxrwx   -          0 2017-03-07 13:28 swift://jzswift.rackspace/touchz
      drwxrwxrwx   -          0 2017-03-07 13:32 swift://jzswift.rackspace/zero
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jzhuge John Zhuge
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: