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

FileUtil uses wrong stat command for FreeBSD

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.21.0
    • Fix Version/s: 2.0.3-alpha
    • Component/s: fs
    • Environment:

      FreeBSD 8.0-STABLE

    • Hadoop Flags:
      Reviewed

      Description

      I get next exception when try to use append:

      2011-05-16 17:07:54,648 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: DatanodeRegistration(10.112.0.207:50010, storageID=DS-1047171559-
      10.112.0.207-50010-1302796304164, infoPort=50075, ipcPort=50020):DataXceiver
      java.io.IOException: Failed to get link count on file /var/data/hdfs/data/current/finalized/subdir26/subdir17/subdir55/blk_-1266943884751786595:
      message=null; error=stat: illegal option – c; exit value=1
      at org.apache.hadoop.fs.FileUtil.createIOException(FileUtil.java:709)
      at org.apache.hadoop.fs.FileUtil.access$000(FileUtil.java:42)
      at org.apache.hadoop.fs.FileUtil$HardLink.getLinkCount(FileUtil.java:682)
      at org.apache.hadoop.hdfs.server.datanode.ReplicaInfo.unlinkBlock(ReplicaInfo.java:215)
      at org.apache.hadoop.hdfs.server.datanode.FSDataset.append(FSDataset.java:1116)

      It seems that FreeBSD is treated like UNIX and so calls 'stat -c%h', while FreeBSD is much more like Mac (since they have same BSD roots):

      $ stat --help
      stat: illegal option – -
      usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...]

      $ stat -f%l a_file
      1

        Attachments

        1. 7294-trunk.patch
          1 kB
          Vitalii Tymchyshyn
        2. patch.diff
          1 kB
          Vitalii Tymchyshyn

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tivv Vitalii Tymchyshyn

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment