[
https://issues.apache.org/jira/browse/HDFS-15154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17032813#comment-17032813
]
Ayush Saxena commented on HDFS-15154:
-------------------------------------
Thanx [~swagle] for the patch. Had a quick look Some minor suggestions :
* The super user check can be done in FSNamesystem, without taking fsn lock.
* For checking super user you can directly use \{{
checkSuperuserPrivilege(operationName);}} depending upon the config, whether
you need to check or not.
* For the test, you have made change in the config for all tests in class, the
other assertions in the same test are also checking with super user check on,
better add a new test and enable the config, for that test only. Well you can
put the tests in {{TestStoragePolicyCommands}}, would be make more sense.
* Test all the scenarios, non super user is allowed with this config turned
off, and not allowed when super user check is enabled, and super user is still
allowed to set policy,
* For asserting the exception you can do something like this :
{code:java}
LambdaTestUtils.intercept(AccessControlException.class, "Permission denied",
"Only super user can set storage policy.",
() -> fs.setStoragePolicy(foo, cold.getName()));
}
{code}
* Add documentation about this change in {{ArchivalStorage.html}}
> Allow only hdfs superusers the ability to assign HDFS storage policies
> ----------------------------------------------------------------------
>
> Key: HDFS-15154
> URL: https://issues.apache.org/jira/browse/HDFS-15154
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: hdfs
> Affects Versions: 3.0.0
> Reporter: Bob Cauthen
> Assignee: Siddharth Wagle
> Priority: Major
> Attachments: HDFS-15154.01.patch, HDFS-15154.02.patch
>
>
> Please provide a way to limit only HDFS superusers the ability to assign HDFS
> Storage Policies to HDFS directories.
> Currently, and based on Jira HDFS-7093, all storage policies can be disabled
> cluster wide by setting the following:
> dfs.storage.policy.enabled to false
> But we need a way to allow only HDFS superusers the ability to assign an HDFS
> Storage Policy to an HDFS directory.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]