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 39627200BB1 for ; Thu, 3 Nov 2016 23:59:38 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 38169160AFF; Thu, 3 Nov 2016 22:59:38 +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 7E50C160AE5 for ; Thu, 3 Nov 2016 23:59:37 +0100 (CET) Received: (qmail 3398 invoked by uid 500); 3 Nov 2016 22:59:36 -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 3387 invoked by uid 99); 3 Nov 2016 22:59:36 -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; Thu, 03 Nov 2016 22:59:36 +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 EA4B31A92ED for ; Thu, 3 Nov 2016 22:59:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-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-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 iXeteMaaFYCC for ; Thu, 3 Nov 2016 22:59:33 +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-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 0CAA05FB6E for ; Thu, 3 Nov 2016 22:59:32 +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 uA3MxVdt010169; Thu, 3 Nov 2016 22:59:31 GMT Message-Id: <201611032259.uA3MxVdt010169@ip-10-146-233-104.ec2.internal> Date: Thu, 3 Nov 2016 22:59:31 +0000 From: "Henry Robinson (Code Review)" To: impala-cr@cloudera.com, reviews@impala.incubator.apache.org Reply-To: henry@cloudera.com X-Gerrit-MessageType: newpatchset 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: dd5d779b4b4c94de987671686af535503f197cf5 In-Reply-To: References: 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:59:38 -0000 Henry Robinson has uploaded a new patch set (#4). 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, 145 insertions(+), 151 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/35/4935/4 -- To view, visit http://gerrit.cloudera.org:8080/4935 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I516357d2b5e9eb83e8209872cbe4c078c778a629 Gerrit-PatchSet: 4 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Henry Robinson