hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thejas M Nair (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-13075) Metastore shuts down when no delegation token is found in ZooKeeper
Date Mon, 22 Feb 2016 17:12:18 GMT

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

Thejas M Nair commented on HIVE-13075:
--------------------------------------

Please note that it is customary to also put the link to reviewboard in the jira.

> Metastore shuts down when no delegation token is found in ZooKeeper
> -------------------------------------------------------------------
>
>                 Key: HIVE-13075
>                 URL: https://issues.apache.org/jira/browse/HIVE-13075
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 1.3.0, 1.2.1
>            Reporter: Piotr WikieĊ‚
>            Priority: Minor
>
> {{ZooKeeperTokenStore}} looks [as follows|https://github.com/apache/hive/blob/branch-1.2/shims/common/src/main/java/org/apache/hadoop/hive/thrift/ZooKeeperTokenStore.java#L397]:
> {code:java}
> @Override
> public DelegationTokenInformation getToken(DelegationTokenIdentifier tokenIdentifier)
{
>   byte[] tokenBytes = zkGetData(getTokenPath(tokenIdentifier));
>   try {
>     return HiveDelegationTokenSupport.decodeDelegationTokenInformation(tokenBytes);
>   } catch (Exception ex) {
>     throw new TokenStoreException("Failed to decode token", ex);
>   }
> }
> {code}
> which is slightly different from [DBTokenStore implementation|https://github.com/apache/hive/blob/branch-1.2/shims/common/src/main/java/org/apache/hadoop/hive/thrift/DBTokenStore.java#L85]
that is protected against {{tokenBytes==null}} because nullable {{tokenBytes}} causes NPE
to be thrown in [HiveDelegationTokenSupport#decodeDelegationTokenInformation|https://github.com/apache/hive/blob/branch-1.2/shims/common/src/main/java/org/apache/hadoop/security/token/delegation/HiveDelegationTokenSupport.java#L51]
> Furthermore, NPE thrown here causes [TokenStoreDelegationTokenSecretManager.ExpiredTokenRemover|https://github.com/apache/hive/blob/branch-1.2/shims/common/src/main/java/org/apache/hadoop/hive/thrift/TokenStoreDelegationTokenSecretManager.java#L333]
to catch it and exits MetaStore.
> {{null}} from {{[zkGetData()|https://github.com/apache/hive/blob/branch-1.2/shims/common/src/main/java/org/apache/hadoop/hive/thrift/ZooKeeperTokenStore.java#L284]}}
is possible during ZooKeeper failure or (and that was our case) when another metastore instance
removes tokens during {{ExpiredTokenRemover}} run. There were two solutions of this problem:
>  * distributed lock in ZooKeeper acquired during one metastore instance's ExpiredTokenRemover
run,
>  * simple null check
> I think null check is sufficient if it is in {{DBTokenStore}}.
> Patch will be attached.
> Sorry for an edit but I think worth mentioning is a fact that possible workaround for
this issue is setting {{hive.cluster.delegation.key.update-interval}}, {{hive.cluster.delegation.token.renew-interval}}
and {{hive.cluster.delegation.token.max-lifetime}} to one year as described [here|https://community.cloudera.com/t5/Web-UI-Hue-Beeswax/Potential-misconfiguration-detected-Hue-Hive-Editor-HiveServer2/m-p/26117/highlight/true#M763].
But in my opinion it is not an engineer-way of doing things ;)



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

Mime
View raw message