Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-5478

File size reports as zero after writing and calling FSDataOutputStream#hsync()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0.0-alpha
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      RHEL/OEL 6u3

      Description

      Using a Java client to write to a FSDataOutputStream. After some data is written and hsync() is called, hdfs dfs -get /path/to/file gets a file containing the data written so-far, all good.

      hdfs dfs -ls /path/to/file however reports a zero-byte file, presumably until the stream is closed (it then shows the correct size). Hue File Browser (running CDH4) also shows zero bytes until the stream is closed.

      See also http://grokbase.com/t/hadoop/hdfs-user/113j63nrce/zero-file-size-after-hsync which discusses the same problem.

      After the buffer is flushed it would be good if the reported file size was updated.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                brett_s_r Brett Randall
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: