[ 
https://issues.apache.org/jira/browse/HDFS-5478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13818630#comment-13818630
 ] 

Brett Randall commented on HDFS-5478:
-------------------------------------

Thanks Vinay - I'm currently using 2.0.0 so can't test this yet, which was 
introduced in 2.0.3.  It looks like it will do the job though.

> File size reports as zero after writing and calling FSDataOutputStream#hsync()
> ------------------------------------------------------------------------------
>
>                 Key: HDFS-5478
>                 URL: https://issues.apache.org/jira/browse/HDFS-5478
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.0.0-alpha
>         Environment: RHEL/OEL 6u3
>            Reporter: Brett Randall
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to