Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3B23E18815 for ; Wed, 17 Feb 2016 15:20:42 +0000 (UTC) Received: (qmail 56558 invoked by uid 500); 17 Feb 2016 15:20:18 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 56297 invoked by uid 500); 17 Feb 2016 15:20:18 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 56119 invoked by uid 99); 17 Feb 2016 15:20:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Feb 2016 15:20:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 5A4942C1F57 for ; Wed, 17 Feb 2016 15:20:18 +0000 (UTC) Date: Wed, 17 Feb 2016 15:20:18 +0000 (UTC) From: =?utf-8?Q?Piotr_Wikie=C5=82_=28JIRA=29?= To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-13075) Metastore shuts down when no delegation token is found in ZooKeeper MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-13075?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Piotr Wikie=C5=82 updated HIVE-13075: -------------------------------- Status: Open (was: Patch Available) > 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 > Reporter: Piotr Wikie=C5=82 > 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/Zo= oKeeperTokenStore.java#L397]: > {code:java} > @Override > public DelegationTokenInformation getToken(DelegationTokenIdentifier toke= nIdentifier) { > byte[] tokenBytes =3D zkGetData(getTokenPath(tokenIdentifier)); > try { > return HiveDelegationTokenSupport.decodeDelegationTokenInformation(to= kenBytes); > } catch (Exception ex) { > throw new TokenStoreException("Failed to decode token", ex); > } > } > {code} > which is slightly different from [DBTokenStore implementation|https://git= hub.com/apache/hive/blob/branch-1.2/shims/common/src/main/java/org/apache/h= adoop/hive/thrift/DBTokenStore.java#L85] that is protected against {{tokenB= ytes=3D=3Dnull}} because nullable {{tokenBytes}} causes NPE to be thrown in= [HiveDelegationTokenSupport#decodeDelegationTokenInformation|https://githu= b.com/apache/hive/blob/branch-1.2/shims/common/src/main/java/org/apache/had= oop/security/token/delegation/HiveDelegationTokenSupport.java#L51] > Furthermore, NPE thrown here causes [TokenStoreDelegationTokenSecretManag= er.ExpiredTokenRemover|https://github.com/apache/hive/blob/branch-1.2/shims= /common/src/main/java/org/apache/hadoop/hive/thrift/TokenStoreDelegationTok= enSecretManager.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/ZooKeeperTokenS= tore.java#L284]}} is possible during ZooKeeper failure or (and that was our= case) when another metastore instance removes tokens during {{ExpiredToken= Remover}} 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. -- This message was sent by Atlassian JIRA (v6.3.4#6332)