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

Duo Zhang commented on HBASE-20507:
-----------------------------------

When rolling a wal, if we fail to create an AsyncFSOutput, for now we will call 
recoverLease to close the file first, and then set overwrite to true to 
overwrite the old broken file and create a new one. The logic is inside the 
FanOutOneBlockAsyncDFSOutputHelper.createOutput, not the high level mechanism 
where we will open a new file to write if we fail to write to the current file.

The UT here is used to confirm that we do not need to call recoverLease. If 
overwrite is true, NN will complete the pending file first and then delete it.

> Do not need to call recoverLease on the broken file when we fail to create a 
> wal writer
> ---------------------------------------------------------------------------------------
>
>                 Key: HBASE-20507
>                 URL: https://issues.apache.org/jira/browse/HBASE-20507
>             Project: HBase
>          Issue Type: Improvement
>          Components: wal
>            Reporter: Duo Zhang
>            Assignee: Duo Zhang
>            Priority: Major
>         Attachments: HBASE-20507.patch
>
>
> I tried locally with a UT, if we overwrite a file which is currently being 
> written, the old file will be completed and then deleted. If you call close 
> on the previous file, a no lease exception will be thrown which means that 
> the file has already been completed.
> So we do not need to close a file if it will be overwritten immediately, 
> since recoverLease may take a very long time...



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to