hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tsz Wo (Nicholas), SZE (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-3331) Some admin methods in NN do not checkSuperuserPrivilege
Date Fri, 27 Apr 2012 19:30:51 GMT

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

Tsz Wo (Nicholas), SZE commented on HDFS-3331:

I agree that checkSuperuserPrivilege should be called before checkOperation but the current
convention is the other way.  I recall one reason to put checkSuperuserPrivilege after safemode
check is that checkSuperuserPrivilege is more expensive.

In the current code, it is inconsistent whether checkOperation is invoked in NameNodeRpcServer
or FSNamesystem.  checkSuperuserPrivilege is usually invoked in FSNamesystem but an exception
is DatanodeManager.refreshNode(Configuration).  It seems that FSNamesystem is the logical
place to make the call since the checkXxx methods are declared in FSNamesystem.

Other operations in FSNamesystem such as setQuota and listCorruptFileBlocks call checkXxx
within the lock.

I will post another patch for following the current convention as close as possible.
> Some admin methods in NN do not checkSuperuserPrivilege
> -------------------------------------------------------
>                 Key: HDFS-3331
>                 URL: https://issues.apache.org/jira/browse/HDFS-3331
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>         Attachments: h3331_20120426.patch
> - setBalancerBandwidth and refreshNodes should checkSuperuserPrivilege
> - finalizeUpgrade should acquire the write lock.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message