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

Arpit Agarwal commented on HDFS-4845:
-------------------------------------

FSNameSystem.deleteInternal calls removeFromInodeMap without holding the FSDir 
write lock. Verified by adding a Preconditions.checkState for the write lock in 
removeFromInodeMap.

{code}
  private boolean deleteInternal(String src, boolean recursive,
      boolean enforcePermission)
      throws AccessControlException, SafeModeException, UnresolvedLinkException,
             IOException {
...
    dir.removeFromInodeMap(removedINodes);
{code}

Looks like we just need to call dir.writeLock() prior to removeFromINodeMap.
                
> FSEditLogLoader gets NPE while accessing INodeMap in TestEditLogRace
> --------------------------------------------------------------------
>
>                 Key: HDFS-4845
>                 URL: https://issues.apache.org/jira/browse/HDFS-4845
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>    Affects Versions: 3.0.0
>            Reporter: Kihwal Lee
>            Assignee: Arpit Agarwal
>            Priority: Critical
>
> TestEditLogRace fails occasionally because it gets NPE from manipulating 
> INodeMap while loading edits.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to