[
https://issues.apache.org/jira/browse/HDFS-7597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15185866#comment-15185866
]
Xiaobing Zhou commented on HDFS-7597:
-------------------------------------
[~daryn] and [~cnauroth] At least for insecure case, HDFS-8855 patch is
necessary because patch here doesn't address that. HDFS-8855 cached UGI based
on users(e.g. real user and/or proxy user). For secure case, that part of
HDFS-8855 could be pulled out unless DataNodeUGIProvider#tokenUGI can't
guarantee different instances of DelegationTokenIdentifier returns same result
of DelegationTokenIdentifier#equals (which is used by LRUMap to query entries)
given the same token passed in by many requests.
DataNodeUGIProvider#tokenUGI
{code}
ByteArrayInputStream buf =
new ByteArrayInputStream(token.getIdentifier());
DataInputStream in = new DataInputStream(buf);
DelegationTokenIdentifier id = new DelegationTokenIdentifier();
id.readFields(in);
UserGroupInformation ugi = id.getUser();
ugi.addToken(token);
return ugi;
{code}
HDFS-7597 patch:
{code}
70 public UserGroupInformation getUser() {
71 UserGroupInformation ugi = ugiCache.get(this);
72 if (ugi == null) {
73 ugi = super.getUser();
74 ugiCache.put(this, ugi);
75 }
76 return ugi;
77 }
{code}
HDFS-8855 patch:
{code}
69 final Token<DelegationTokenIdentifier> token =
params.delegationToken();
70
71 ugi = ugiCache.get(buildTokenCacheKey(token),
72 new Callable<UserGroupInformation>() {
73 @Override
74 public UserGroupInformation call() throws Exception {
75 return tokenUGI(token);
76 }
77 });
{code}
> DNs should not open new NN connections when webhdfs clients seek
> ----------------------------------------------------------------
>
> Key: HDFS-7597
> URL: https://issues.apache.org/jira/browse/HDFS-7597
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: webhdfs
> Affects Versions: 2.0.0-alpha
> Reporter: Daryn Sharp
> Assignee: Daryn Sharp
> Priority: Critical
> Labels: BB2015-05-TBR
> Attachments: HDFS-7597.patch, HDFS-7597.patch, HDFS-7597.patch
>
>
> Webhdfs seeks involve closing the current connection, and reissuing a new
> open request with the new offset. The RPC layer caches connections so the DN
> keeps a lingering connection open to the NN. Connection caching is in part
> based on UGI. Although the client used the same token for the new offset
> request, the UGI is different which forces the DN to open another unnecessary
> connection to the NN.
> A job that performs many seeks will easily crash the NN due to fd exhaustion.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)