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

Duo Zhang commented on HBASE-15684:
-----------------------------------

Oh there are some problems...

Now we close WAL writer asynchronously in AsyncFSWAL, so we do not know the 
final size in replaceWriter because we will write a trailer when closing. The 
async close is an optimize that makes replaceWriter run faster since it does 
not impact correctness but it does make our log file size accounting broken...

And even for FSHLog, the log file size accounting can still be broken if we 
fail to close the file and do not have any unflushed WAL entries. This way the 
file length maybe changed by namenode after lease recovery.

Since the returned log size is mainly used in metrics, I think it does not need 
to be accurate. Let me find a way to fix this.

Thanks.

> Typo in AbstractFSWAL.replaceWriter
> -----------------------------------
>
>                 Key: HBASE-15684
>                 URL: https://issues.apache.org/jira/browse/HBASE-15684
>             Project: HBase
>          Issue Type: Bug
>          Components: wal
>    Affects Versions: 2.0.0
>            Reporter: Duo Zhang
>            Assignee: Duo Zhang
>             Fix For: 2.0.0
>
>
> {code}
> long oldFileLen = 0L;
>       doReplaceWriter(oldPath, newPath, nextWriter);
> {code}
> Should be
> {code}
> long oldFileLen =  doReplaceWriter(oldPath, newPath, nextWriter);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to