[
https://issues.apache.org/jira/browse/HDFS-4506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13829474#comment-13829474
]
Kousuke Saruta commented on HDFS-4506:
--------------------------------------
getLocalBLockReader calls BlockReaderLocal.newBlockReader and newBlockReader
accesses local file. When we access local files with FileInputStream ( and
subclasses ) without proper permission, FileNotFoundException will be thrown.
So, can we modify like as follows?
{code}
private BlockReader getLocalBlockReader(Configuration conf,
String src, Block blk, Token<BlockTokenIdentifier> accessToken,
DatanodeInfo chosenNode, int socketTimeout, long offsetIntoBlock)
throws InvalidToken, IOException {
try {
return BlockReaderLocal.newBlockReader(conf, src, blk, accessToken,
chosenNode, socketTimeout, offsetIntoBlock, blk.getNumBytes()
- offsetIntoBlock, connectToDnViaHostname);
- } catch (RemoteException re) {
- throw re.unwrapRemoteException(InvalidToken.class,
- AccessControlException.class);
+ } catch (FileNotFoundException fe) {
+ throw new AcceccControlException(fe);
+ } catch (IOException ie) {
+ throw ie;
}
}
{code}
> In branch-1, HDFS short circuit fails non-transparently when user does not
> have unix permissions
> ------------------------------------------------------------------------------------------------
>
> Key: HDFS-4506
> URL: https://issues.apache.org/jira/browse/HDFS-4506
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: hdfs-client
> Affects Versions: 1.1.1
> Reporter: Enis Soztutar
>
> We found a case, where if the short circuit user name is configured
> correctly, but the user does not have enough permissions in unix, DFS
> operations fails with IOException, rather than silently failing over through
> datanode.
--
This message was sent by Atlassian JIRA
(v6.1#6144)