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

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

Duplicate of HDFS-4213.  Only question is whether a normal hsync() or hflush() 
should update this by default and without needing to cast-down, or whether that 
is too expensive to happen by-default.

> 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