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 1D5F0200BB1 for ; Thu, 3 Nov 2016 23:56:11 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1BD66160AFF; Thu, 3 Nov 2016 22:56:11 +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 60568160AE5 for ; Thu, 3 Nov 2016 23:56:10 +0100 (CET) Received: (qmail 98925 invoked by uid 500); 3 Nov 2016 22:56:09 -0000 Mailing-List: contact reviews-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@impala.incubator.apache.org Received: (qmail 98914 invoked by uid 99); 3 Nov 2016 22:56:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Nov 2016 22:56:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id A8660CD422 for ; Thu, 3 Nov 2016 22:56:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.363 X-Spam-Level: X-Spam-Status: No, score=0.363 tagged_above=-999 required=6.31 tests=[RDNS_DYNAMIC=0.363, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id AJsQippS8FrN for ; Thu, 3 Nov 2016 22:56:06 +0000 (UTC) Received: from ip-10-146-233-104.ec2.internal (ec2-75-101-130-251.compute-1.amazonaws.com [75.101.130.251]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 852735F24F for ; Thu, 3 Nov 2016 22:56:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ip-10-146-233-104.ec2.internal (8.14.4/8.14.4) with ESMTP id uA3MtwiV009902; Thu, 3 Nov 2016 22:55:58 GMT Date: Thu, 3 Nov 2016 22:55:58 +0000 From: "Henry Robinson (Code Review)" To: impala-cr@cloudera.com, reviews@impala.incubator.apache.org Message-ID: Reply-To: henry@cloudera.com X-Gerrit-MessageType: newchange Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-3882=3A_Simplify_some_query_exec_state_locking=0A?= X-Gerrit-Change-Id: I516357d2b5e9eb83e8209872cbe4c078c778a629 X-Gerrit-ChangeURL: X-Gerrit-Commit: 477708e4cba93f99c4218ba2fdbb996c6ddec6e8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.12.2 archived-at: Thu, 03 Nov 2016 22:56:11 -0000 Henry Robinson has uploaded a new change for review. http://gerrit.cloudera.org:8080/4935 Change subject: IMPALA-3882: Simplify some query exec state locking ...................................................................... IMPALA-3882: Simplify some query exec state locking query_exec_state_map_lock_ is implicated in many deadlock paths, and is heavily contended. This patch simplifies the usage of query_exec_state_map_lock_ by requiring that it is a 'terminal' lock - i.e. that it is incorrect to take any other locks while holding the map lock. The most significant change is to remove the code path from GetQueryExecState() that could take QueryExecState::lock() *before* yielding the query_exec_state_map_lock_. Instead, callers have to take the exec state lock themselves. Also change registration path so that QueryExecState::lock is not held during planning. This prevents blocking e.g. web pages that need to read QES data structures to produce their output. A subtlety of the previous registration code path is that it forced callers of get_metadata() rpcs to wait until registration and planning was complete so that the query metadata was always available. This patch replaces that logic with a promise that the RPC can block on, which is triggered when metadata is available, rather than implicitly relying on the locking protocol. Also rename some QES methods to make it clearer what they do. Change-Id: I516357d2b5e9eb83e8209872cbe4c078c778a629 --- M be/src/service/impala-beeswax-server.cc M be/src/service/impala-hs2-server.cc M be/src/service/impala-http-handler.cc M be/src/service/impala-server.cc M be/src/service/impala-server.h M be/src/service/query-exec-state.cc M be/src/service/query-exec-state.h 7 files changed, 139 insertions(+), 146 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/35/4935/3 -- To view, visit http://gerrit.cloudera.org:8080/4935 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I516357d2b5e9eb83e8209872cbe4c078c778a629 Gerrit-PatchSet: 3 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Henry Robinson