You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Konstantin Shvachko (JIRA)" <ji...@apache.org> on 2009/01/07 20:10:44 UTC

[jira] Commented: (HADOOP-4972) FSNamesystem.countNodes(Block b) should be synchronized.

    [ https://issues.apache.org/jira/browse/HADOOP-4972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12661664#action_12661664 ] 

Konstantin Shvachko commented on HADOOP-4972:
---------------------------------------------

I checked the trunk - all calls to {{FSNamesystem.countNodes()}} are done under the FSNamesystem lock.
Could you please check earlier versions. If it is not synchronized in them we should fix it there, if not the issue can be closed.

> FSNamesystem.countNodes(Block b) should be synchronized.
> --------------------------------------------------------
>
>                 Key: HADOOP-4972
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4972
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>            Reporter: Tsz Wo (Nicholas), SZE
>
> (Copied a [comment|https://issues.apache.org/jira/browse/HADOOP-4840?focusedCommentId=12657242#action_12657242] from HADOOP-4840.)
> FSNamesystem.countNodes(..) is called in many places including:
>     * FSNamesystem.addStoredBlock(Block, DatanodeDescriptor, DatanodeDescriptor)
>     * FSNamesystem.checkReplicationFactor(INodeFile)
>     * FSNamesystem.decrementSafeBlockCount(Block)
>     * FSNamesystem.getBlockLocationsInternal(String, INodeFile, long, long, int, boolean)
>     * FSNamesystem.invalidateBlock(Block, DatanodeInfo)
>     * FSNamesystem.isReplicationInProgress(DatanodeDescriptor)
>     * FSNamesystem.markBlockAsCorrupt(Block, DatanodeInfo)
>     * FSNamesystem.processMisReplicatedBlocks()
>     * FSNamesystem.processPendingReplications()
>     * FSNamesystem.updateNeededReplications(Block, int, int)
> However, some of them, e.g. getBlockLocationsInternal, call countNodes(..) without owning the fsnamesystem lock before calling . It may causes NPE in runtime.

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