You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Rakesh R (JIRA)" <ji...@apache.org> on 2015/11/26 07:10:10 UTC

[jira] [Commented] (HDFS-8648) Revisit FsDirectory#resolvePath() function usage to check the call is made under proper lock

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

Rakesh R commented on HDFS-8648:
--------------------------------

Attached initial patch, here I've tried moving the {{fsd#resolvePath()}} function call under fsd#lock. I haven't included the {{FsDirWriteFileOp.java}} changes, as this requires more refactoring. Will incorporate this changes later in this jira or a separate sub-task.

> Revisit FsDirectory#resolvePath() function usage to check the call is made under proper lock
> --------------------------------------------------------------------------------------------
>
>                 Key: HDFS-8648
>                 URL: https://issues.apache.org/jira/browse/HDFS-8648
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Rakesh R
>            Assignee: Rakesh R
>         Attachments: HDFS-8648-00.patch
>
>
> As per the [discussion|https://issues.apache.org/jira/browse/HDFS-8493?focusedCommentId=14595735&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14595735] in HDFS-8493 the function {{FsDirectory#resolvePath}} usage needs to be reviewed. It seems there are many places it has done the resolution {{fsd.resolvePath(pc, src, pathComponents);}} by acquiring only fsn lock and not fsd lock. As per the initial analysis following are such cases, probably it needs to filter out and fix wrong usage.
> # FsDirAclOp.java
> -> getAclStatus()
> -> modifyAclEntries()
> -> removeAcl()
> -> removeDefaultAcl()
> -> setAcl()
> -> getAclStatus()
> # FsDirDeleteOp.java
> -> delete(fsn, src, recursive, logRetryCache)
> # FsDirRenameOp.java
> -> renameToInt(fsd, srcArg, dstArg, logRetryCache)
> -> renameToInt(fsd, srcArg, dstArg, logRetryCache, options)
> # FsDirStatAndListingOp.java
> -> getContentSummary(fsd, src)
> -> getFileInfo(fsd, srcArg, resolveLink)
> -> isFileClosed(fsd, src)
> -> getListingInt(fsd, srcArg, startAfter, needLocation)
> # FsDirWriteFileOp.java
> -> abandonBlock()
> -> completeFile(fsn, pc, srcArg, holder, last, fileId)
> -> getEncryptionKeyInfo(fsn, pc, src, supportedVersions)
> -> startFile()
> -> validateAddBlock()
> # FsDirXAttrOp.java
> -> getXAttrs(fsd, srcArg, xAttrs)
> -> listXAttrs(fsd, src)
> -> setXAttr(fsd, src, xAttr, flag, logRetryCache)
> # FSNamesystem.java
> -> createEncryptionZoneInt()
> -> getEZForPath()
> Thanks [~wheat9], [~vinayrpet] for the advice.



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