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 66E36200C5E for ; Sat, 22 Apr 2017 18:40:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5ABAB160BB3; Sat, 22 Apr 2017 16:40:09 +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 A8386160B91 for ; Sat, 22 Apr 2017 18:40:08 +0200 (CEST) Received: (qmail 31482 invoked by uid 500); 22 Apr 2017 16:40:07 -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 31473 invoked by uid 99); 22 Apr 2017 16:40:07 -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, 22 Apr 2017 16:40:07 +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 4BB621809FC for ; Sat, 22 Apr 2017 16:40:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-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-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id BQBAatlTRU6b for ; Sat, 22 Apr 2017 16:40:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 222185FACD for ; Sat, 22 Apr 2017 16:40:06 +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 4A824E0D3A for ; Sat, 22 Apr 2017 16:40:05 +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 4D1EB21B57 for ; Sat, 22 Apr 2017 16:40:04 +0000 (UTC) Date: Sat, 22 Apr 2017 16:40:04 +0000 (UTC) From: "Eugene Koifman (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (HIVE-16321) Possible deadlock in metastore with Acid enabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 22 Apr 2017 16:40:09 -0000 [ https://issues.apache.org/jira/browse/HIVE-16321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15980019#comment-15980019 ] Eugene Koifman edited comment on HIVE-16321 at 4/22/17 4:39 PM: ---------------------------------------------------------------- committed to branch-2 (2.4.0) https://github.com/apache/hive/commit/59faf36952f70d243ba997e54c1349ea2c01e670 was (Author: ekoifman): committed to branch-2 https://github.com/apache/hive/commit/59faf36952f70d243ba997e54c1349ea2c01e670 > Possible deadlock in metastore with Acid enabled > ------------------------------------------------ > > Key: HIVE-16321 > URL: https://issues.apache.org/jira/browse/HIVE-16321 > Project: Hive > Issue Type: Bug > Components: Transactions > Affects Versions: 1.3.0 > Reporter: Eugene Koifman > Assignee: Eugene Koifman > Priority: Blocker > Attachments: HIVE-16321.01-branch-2.3.patch, HIVE-16321.01.branch-2.patch, HIVE-16321.01.patch, HIVE-16321.02.branch-2.patch, HIVE-16321.02.patch, HIVE-16321.03-branch-2.patch, HIVE-16321.03.patch, HIVE-16321.05-branch-2.3.patch > > > TxnStore.MutexAPI is a mechanism how different Metastore instances can coordinate their operations. It uses a JDBCConnection to achieve it. > In some cases this may lead to deadlock. TxnHandler uses a connection pool of fixed size. Suppose you have X simultaneous calls to TxnHandler.lock(), where X is >= size of the pool. This take all connections form the pool, so when > {noformat} > handle = getMutexAPI().acquireLock(MUTEX_KEY.CheckLock.name()); > {noformat} > is executed in _TxnHandler.checkLock(Connection dbConn, long extLockId)_ the pool is empty and the system is deadlocked. > MutexAPI can't use the same connection as the operation it's protecting. (TxnHandler.checkLock(Connection dbConn, long extLockId) is an example). > We could make MutexAPI use a separate connection pool (size > 'primary' conn pool). > Or we could make TxnHandler.lock(LockRequest rqst) return immediately after enqueueing the lock with the expectation that the caller will always follow up with a call to checkLock(CheckLockRequest rqst). > cc [~f1sherox] -- This message was sent by Atlassian JIRA (v6.3.15#6346)