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 4E731200D2F for ; Wed, 1 Nov 2017 18:34:49 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4CC8A160BEA; Wed, 1 Nov 2017 17:34:49 +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 91D4F1609EC for ; Wed, 1 Nov 2017 18:34:48 +0100 (CET) Received: (qmail 70822 invoked by uid 500); 1 Nov 2017 17:34:47 -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 70803 invoked by uid 99); 1 Nov 2017 17:34:47 -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; Wed, 01 Nov 2017 17:34:47 +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 C7D75182D21 for ; Wed, 1 Nov 2017 17:34:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.362 X-Spam-Level: ** X-Spam-Status: No, score=2.362 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RDNS_DYNAMIC=0.363, SPF_PASS=-0.001] 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 1xiQbJrg6ibM for ; Wed, 1 Nov 2017 17:34:45 +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 99C1B5FAEA for ; Wed, 1 Nov 2017 17:34:44 +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 vA1HYgkr015600; Wed, 1 Nov 2017 17:34:42 GMT Message-Id: <201711011734.vA1HYgkr015600@ip-10-146-233-104.ec2.internal> X-Gerrit-PatchSet: 5 Date: Wed, 1 Nov 2017 17:34:41 +0000 From: "Tim Armstrong (Code Review)" To: anujphadke , Joe McDonnell , Dan Hecht , impala-cr@cloudera.com, reviews@impala.incubator.apache.org X-Gerrit-MessageType: newpatchset Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-1575=3A_part_2=3A_yield_admission_control_resources=0A?= X-Gerrit-Change-Id: I80279eb2bda740d7f61420f52db3bfa42a6a51ac X-Gerrit-Change-Number: 8323 X-Gerrit-ChangeURL: X-Gerrit-Commit: f9cab77348d978eea7c2b2cf46ed7f4cdcca4a0e In-Reply-To: References: Reply-To: tarmstrong@cloudera.com, impala-cr@cloudera.com, aphadke@cloudera.com, marcelk@gmail.com, dhecht@cloudera.com, joemcdonnell@cloudera.com, reviews@impala.incubator.apache.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.14.2 Content-Type: multipart/alternative; boundary="V/I0QOHsRRU="; charset=UTF-8 archived-at: Wed, 01 Nov 2017 17:34:49 -0000 --V/I0QOHsRRU= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello anujphadke, Joe McDonnell, Dan Hecht, I'd like you to reexamine a c= hange=2E Please visit http://gerrit=2Ecloudera=2Eorg:8080/8323 to loo= k at the new patch set (#5)=2E Change subject: IMPALA-1575: part 2: yield = admission control resources =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E= =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E= =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E= =2E=2E=2E=2E=2E IMPALA-1575: part 2: yield admission control resources Th= is change releases admission control resources more eagerly, once the query= has finished actively executing=2E Some resources (tracked and untracked) = are still consumed by the client request as long as it remains open, e=2Eg= =2E memory for control structures and the result cache=2E However, these re= sources are relatively small and should not block admission of new queries= =2E The same as in part 1, query execution is considered to be finished un= der any of the following conditions: 1=2E The query encounters an error and= fails 2=2E The query is cancelled due to the idle query timeout 3=2E The q= uery reaches eos (or the DML completes) 4=2E The client cancels the query w= ithout closing the query Admission control resources are released in two w= ays: 1=2E by calling AdmissionController::ReleaseQuery() on the coordinator= promptly after query execution finishes, instead of waiting for Unre= gisterQuery()=2E This means that the query and its memory is no longer c= onsidered "admitted"=2E 2=2E by changing the behaviour of MemTracker::GetPo= olMemReserved() so that it is aware of when a query has finished executi= ng and does not consider its entire memory limit to be "reserved"=2E Th= e preconditions for releasing an admitted query are subtle because the quer= ies are being admitted to a distributed system, not just the coordinator=2E= The comment for ReleaseAdmissionControlResources() documents the precondi= tions and rationale=2E Note that the preconditions are not weaker than the = preconditions of calling UnregisterQuery() before this patch=2E Testing: T= estAdmissionController is extended to end queries in four ways: cancellatio= n by client, idle timeout, the last row being fetched, and the client closi= ng the query=2E The test uses a mix of all four=2E After the query ends, al= l clients wait for the test to complete before closing the query or closing= the connection=2E This ensures that the admission control decisions are ba= sed entirely on the query end behavior=2E This test works for both query ad= mission control and mem_limit admission control and can detect both kinds o= f admission control resources ("admitted" and "reserved") not being release= d promptly=2E This is based on an earlier patch by Joe McDonnell=2E Chang= e-Id: I80279eb2bda740d7f61420f52db3bfa42a6a51ac --- M be/src/runtime/coordi= nator=2Ecc M be/src/runtime/coordinator=2Eh M be/src/runtime/mem-tracker=2E= cc M be/src/runtime/mem-tracker=2Eh M be/src/runtime/query-state=2Ecc M be/= src/scheduling/admission-controller=2Ecc M be/src/scheduling/admission-cont= roller=2Eh M be/src/service/client-request-state=2Ecc M tests/custom_cluste= r/test_admission_controller=2Epy 9 files changed, 192 insertions(+), 87 del= etions(-) git pull ssh://gerrit=2Ecloudera=2Eorg:29418/Impala-ASF refs/= changes/23/8323/5 -- To view, visit http://gerrit=2Ecloudera=2Eorg:8080/83= 23 To unsubscribe, visit http://gerrit=2Ecloudera=2Eorg:8080/settings Gerr= it-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newpatchse= t Gerrit-Change-Id: I80279eb2bda740d7f61420f52db3bfa42a6a51ac Gerrit-Change= -Number: 8323 Gerrit-PatchSet: 5 Gerrit-Owner: Tim Armstrong Gerrit-Reviewer: Dan Hecht Gerrit-Rev= iewer: Joe McDonnell Gerrit-Reviewer: Tim Arm= strong Gerrit-Reviewer: anujphadke --V/I0QOHsRRU=--