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

Kannan Muthukkaruppan commented on HBASE-2398:
----------------------------------------------

Nicolas spotted that there is a race condition now because the 
this.writer.getLength() is not done under the updatelock, and a log roll might 
be happening on the side. 

During the log roll, there is a brief window where a call to 
this.writer.close() has happened, and the new writer hasn't been allocated. 

If SequenceFile.java:getLength() checked for out being NULL and returned zero, 
that would work. That fix should probably be done too to hadoop.

To work with older versions of hadoop which do not have this patch, Nicolas 
suggested the moving the log roll logic to hflush()-- there we are already 
under the updateLock. And that seems like a good centralized place to decide on 
log rolls as well. 








> NPE in HLog.append when calling writer.getLength
> ------------------------------------------------
>
>                 Key: HBASE-2398
>                 URL: https://issues.apache.org/jira/browse/HBASE-2398
>             Project: Hadoop HBase
>          Issue Type: Bug
>            Reporter: Jean-Daniel Cryans
>            Assignee: Kannan Muthukkaruppan
>             Fix For: 0.20.4, 0.21.0
>
>
> Doing some test uploads on a fresh single node setup, I'm seeing non-fatal 
> NPEs in the region server log coming from HLog.append when calling 
> writer.getLength. I'll post a log in a follow-up comment.
> Assigning to Nicolas so that he takes a look.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to