Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A5DB5200C1F for ; Sat, 4 Feb 2017 02:29:57 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A457B160B55; Sat, 4 Feb 2017 01:29:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EDEF2160B3F for ; Sat, 4 Feb 2017 02:29:56 +0100 (CET) Received: (qmail 65135 invoked by uid 500); 4 Feb 2017 01:29:56 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 65124 invoked by uid 99); 4 Feb 2017 01:29:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Feb 2017 01:29:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 91888181BC0 for ; Sat, 4 Feb 2017 01:29:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.199 X-Spam-Level: X-Spam-Status: No, score=-1.199 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Q5ycQAdAVTUx for ; Sat, 4 Feb 2017 01:29:54 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id C74645F30A for ; Sat, 4 Feb 2017 01:29:53 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id CE2F0E010F for ; Sat, 4 Feb 2017 01:29:51 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 8C4F325286 for ; Sat, 4 Feb 2017 01:29:51 +0000 (UTC) Date: Sat, 4 Feb 2017 01:29:51 +0000 (UTC) From: "Xiao Chen (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HADOOP-14044) Synchronization issue in delegation token cancel functionality MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 04 Feb 2017 01:29:57 -0000 [ https://issues.apache.org/jira/browse/HADOOP-14044?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Xiao Chen updated HADOOP-14044: ------------------------------- Resolution: Fixed Hadoop Flags: Reviewed Fix Version/s: 3.0.0-alpha3 2.9.0 Status: Resolved (was: Patch Available) Test failure look unrelated and passes locally. Also ran TestKMS in hadoop-kms and TestDelegationtoken in hadoop-hdfs, both passed. Committed trunk and branch-2, thanks for reporting and fixing the issue, [~hgadre], and nice discussions! > Synchronization issue in delegation token cancel functionality > -------------------------------------------------------------- > > Key: HADOOP-14044 > URL: https://issues.apache.org/jira/browse/HADOOP-14044 > Project: Hadoop Common > Issue Type: Bug > Reporter: Hrishikesh Gadre > Assignee: Hrishikesh Gadre > Fix For: 2.9.0, 3.0.0-alpha3 > > Attachments: dt_fail.log, dt_success.log, HADOOP-14044-001.patch, HADOOP-14044-002.patch, HADOOP-14044-003.patch > > > We are using Hadoop delegation token authentication functionality in Apache Solr. As part of the integration testing, I found following issue with the delegation token cancelation functionality. > Consider a setup with 2 Solr servers (S1 and S2) which are configured to use delegation token functionality backed by Zookeeper. Now invoke following steps, > [Step 1] Send a request to S1 to create a delegation token. > (Delegation token DT is created successfully) > [Step 2] Send a request to cancel DT to S2 > (DT is canceled successfully. client receives HTTP 200 response) > [Step 3] Send a request to cancel DT to S2 again > (DT cancelation fails. client receives HTTP 404 response) > [Step 4] Send a request to cancel DT to S1 > At this point we get two different responses. > - DT cancelation fails. client receives HTTP 404 response > - DT cancelation succeeds. client receives HTTP 200 response > Also as per the current implementation, each server maintains an in_memory cache of current tokens which is updated using the ZK watch mechanism. e.g. the ZK watch on S1 will ensure that the in_memory cache is synchronized after step 2. > After investigation, I found the root cause for this behavior is due to the race condition between step 4 and the firing of ZK watch on S1. Whenever the watch fires before the step 4 - we get HTTP 404 response (as expected). When that is not the case - we get HTTP 200 response along with following ERROR message in the log, > {noformat} > Attempted to remove a non-existing znode /ZKDTSMTokensRoot/DT_XYZ > {noformat} > From client perspective, the server *should* return HTTP 404 error when the cancel request is sent out for an invalid token. > Ref: Here is the relevant Solr unit test for reference, > https://github.com/apache/lucene-solr/blob/746786636404cdb8ce505ed0ed02b8d9144ab6c4/solr/core/src/test/org/apache/solr/cloud/TestSolrCloudWithDelegationTokens.java#L285 -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-issues-help@hadoop.apache.org