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 8AA6C200D28 for ; Mon, 9 Oct 2017 02:50:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 89211160BDE; Mon, 9 Oct 2017 00:50:05 +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 A90811609E6 for ; Mon, 9 Oct 2017 02:50:04 +0200 (CEST) Received: (qmail 44374 invoked by uid 500); 9 Oct 2017 00:50:03 -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 44365 invoked by uid 99); 9 Oct 2017 00:50:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Oct 2017 00:50:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id E7C901A4745 for ; Mon, 9 Oct 2017 00:50:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id K7FG-0HqryLF for ; Mon, 9 Oct 2017 00:50:01 +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 15D0B60D31 for ; Mon, 9 Oct 2017 00:50:01 +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 4C067E02C7 for ; Mon, 9 Oct 2017 00:50:00 +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 093F42435A for ; Mon, 9 Oct 2017 00:50:00 +0000 (UTC) Date: Mon, 9 Oct 2017 00:50:00 +0000 (UTC) From: "Thai Bui (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-17502) Reuse of default session should not throw an exception in LLAP w/ Tez MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 09 Oct 2017 00:50:05 -0000 [ https://issues.apache.org/jira/browse/HIVE-17502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thai Bui updated HIVE-17502: ---------------------------- Fix Version/s: 3.0.0 Release Note: Add an option to allow parallel default sessions reuse in HiveServer2 with LLAP/Tez Status: Patch Available (was: In Progress) > Reuse of default session should not throw an exception in LLAP w/ Tez > --------------------------------------------------------------------- > > Key: HIVE-17502 > URL: https://issues.apache.org/jira/browse/HIVE-17502 > Project: Hive > Issue Type: Bug > Components: llap, Tez > Affects Versions: 2.2.0, 2.1.1 > Environment: HDP 2.6.1.0-129, Hue 4 > Reporter: Thai Bui > Assignee: Thai Bui > Fix For: 3.0.0 > > Attachments: HIVE-17502.patch > > > Hive2 w/ LLAP on Tez doesn't allow a currently used, default session to be skipped mostly because of this line https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionPoolManager.java#L365. > However, some clients such as Hue 4, allow multiple sessions to be used per user. Under this configuration, a Thrift client will send a request to either reuse or open a new session. The reuse request could include the session id of a currently used snippet being executed in Hue, this causes HS2 to throw an exception: > {noformat} > 2017-09-10T17:51:36,548 INFO [Thread-89]: tez.TezSessionPoolManager (TezSessionPoolManager.java:canWorkWithSameSession(512)) - The current user: hive, session user: hive > 2017-09-10T17:51:36,549 ERROR [Thread-89]: exec.Task (TezTask.java:execute(232)) - Failed to execute tez graph. > org.apache.hadoop.hive.ql.metadata.HiveException: The pool session sessionId=5b61a578-6336-41c5-860d-9838166f97fe, queueName=llap, user=hive, doAs=false, isOpen=true, isDefault=true, expires in 591015330ms should have been returned to the pool > at org.apache.hadoop.hive.ql.exec.tez.TezSessionPoolManager.canWorkWithSameSession(TezSessionPoolManager.java:534) ~[hive-exec-2.1.0.2.6.1.0-129.jar:2.1.0.2.6.1.0-129] > at org.apache.hadoop.hive.ql.exec.tez.TezSessionPoolManager.getSession(TezSessionPoolManager.java:544) ~[hive-exec-2.1.0.2.6.1.0-129.jar:2.1.0.2.6.1.0-129] > at org.apache.hadoop.hive.ql.exec.tez.TezTask.execute(TezTask.java:147) [hive-exec-2.1.0.2.6.1.0-129.jar:2.1.0.2.6.1.0-129] > at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:197) [hive-exec-2.1.0.2.6.1.0-129.jar:2.1.0.2.6.1.0-129] > at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:100) [hive-exec-2.1.0.2.6.1.0-129.jar:2.1.0.2.6.1.0-129] > at org.apache.hadoop.hive.ql.exec.TaskRunner.run(TaskRunner.java:79) [hive-exec-2.1.0.2.6.1.0-129.jar:2.1.0.2.6.1.0-129] > {noformat} > Note that every query is issued as a single 'hive' user to share the LLAP daemon pool, a set of pre-determined number of AMs is initialized at setup time. Thus, HS2 should allow new sessions from a Thrift client to be used out of the pool, or an existing session to be skipped and an unused session from the pool to be returned. The logic to throw an exception in the `canWorkWithSameSession` doesn't make sense to me. > I have a solution to fix this issue in my local branch at https://github.com/thaibui/hive/commit/078a521b9d0906fe6c0323b63e567f6eee2f3a70. When applied, the log will become like so > {noformat} > 2017-09-10T09:15:33,578 INFO [Thread-239]: tez.TezSessionPoolManager (TezSessionPoolManager.java:canWorkWithSameSession(533)) - Skipping default session sessionId=6638b1da-0f8a-405e-85f0-9586f484e6de, queueName=llap, user=hive, doAs=false, isOpen=true, isDefault=true, expires in 591868732ms since it is being used. > {noformat} > A test case is provided in my branch to demonstrate how it works. If possible I would like this patch to be applied to version 2.1, 2.2 and master. Since we are using 2.1 LLAP in production with Hue 4, this patch is critical to our success. > Alternatively, if this patch is too broad in scope, I propose adding an option to allow "skipping of currently used default sessions". With this new option default to "false", existing behavior won't change unless the option is turned on. > I will prepare an official path if this change to master &/ the other branches is acceptable. I'm not an contributor &/ committer, this will be my first time contributing to Hive and the Apache foundation. Any early review is greatly appreciated, thanks! -- This message was sent by Atlassian JIRA (v6.4.14#64029)