hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Piotr Wikieł (JIRA) <>
Subject [jira] [Created] (HIVE-13075) Metastore shuts down when no delegation token is found in ZooKeeper
Date Wed, 17 Feb 2016 15:13:18 GMT
Piotr Wikieł created HIVE-13075:

             Summary: Metastore shuts down when no delegation token is found in ZooKeeper
                 Key: HIVE-13075
             Project: Hive
          Issue Type: Bug
            Reporter: Piotr Wikieł
            Priority: Minor

{{ZooKeeperTokenStore}} looks [as follows|]:

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);

which is slightly different from [DBTokenStore implementation|]
that is protected against {{tokenBytes==null}} because nullable {{tokenBytes}} causes NPE
to be thrown in [HiveDelegationTokenSupport#decodeDelegationTokenInformation|]

Furthermore, NPE thrown here causes [TokenStoreDelegationTokenSecretManager.ExpiredTokenRemover|]
to catch it and exits MetaStore.

{{null}} from {{[zkGetData()|]}}
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
 * simple null check

I think null check is sufficient if it is in {{DBTokenStore}}.

Patch will be attached.

This message was sent by Atlassian JIRA

View raw message