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 43E3B200D1E for ; Wed, 18 Oct 2017 18:13:52 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 425BE160BEA; Wed, 18 Oct 2017 16:13:52 +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 87F6F1609EE for ; Wed, 18 Oct 2017 18:13:51 +0200 (CEST) Received: (qmail 41986 invoked by uid 500); 18 Oct 2017 16:13:50 -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 41975 invoked by uid 99); 18 Oct 2017 16:13:50 -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, 18 Oct 2017 16:13:50 +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 B78BA18056F for ; Wed, 18 Oct 2017 16:13:49 +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 IUFj3DacxvCz for ; Wed, 18 Oct 2017 16:13:47 +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 E90595FC6C for ; Wed, 18 Oct 2017 16:13:46 +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 v9IGDiu2030387; Wed, 18 Oct 2017 16:13:44 GMT Message-Id: <201710181613.v9IGDiu2030387@ip-10-146-233-104.ec2.internal> X-Gerrit-PatchSet: 9 Date: Wed, 18 Oct 2017 16:13:44 +0000 From: "Tim Armstrong (Code Review)" To: Joe McDonnell , 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_1=3A_eagerly_release_query_exec_resources=0A?= X-Gerrit-Change-Id: I41ff374b0403f10a145f7fee9b3145953ee32341 X-Gerrit-Change-Number: 8303 X-Gerrit-ChangeURL: X-Gerrit-Commit: eaf077ef4e4f47c212a816db05512fe532712180 In-Reply-To: References: Reply-To: tarmstrong@cloudera.com, impala-cr@cloudera.com, marcelk@gmail.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="k7xFYCw8ubI="; charset=UTF-8 archived-at: Wed, 18 Oct 2017 16:13:52 -0000 --k7xFYCw8ubI= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello Joe McDonnell, I'd like you to reexamine a change=2E Please visit = http://gerrit=2Ecloudera=2Eorg:8080/8303 to look at the new patch set = (#9)=2E Change subject: IMPALA-1575: Part 1: eagerly release query exec re= sources =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 IMPA= LA-1575: Part 1: eagerly release query exec resources Release of backend r= esources for query execution on the coordinator daemon should occur eagerly= as soon as query execution is finished or cancelled=2E Before this patch s= ome resources managed by QueryState, like scratch files, were only released= when the query was closed and all of the query's control structures were t= orn down=2E These resources are referred to as "ExecResources" in various = places to distinguish them from resources associated with the client reques= t (like the result cache) that are still required after the query finishes = executing=2E This first change does not solve the admission control proble= m for two reasons: * We don't release the "admitted" memory on the coordina= tor until the query is unregistered=2E * Admission control still consider= s the memory reserved until the query memtracker is unregistered, which h= appens only when the QueryState is destroyed: see MemTracker::GetPoolMemR= eserved()=2E The flow is mostly similar to initial_reservation_refcnt_, ex= cept the coordinator also holds onto a reference count, which is released w= hen either the final row is returned or cancellation is initiated=2E After = the coordinator releases its refcount, the resources can be freed as soon a= s local fragments also release their refcounts=2E Also clean up Coordinato= r slightly by preventing runtime_state() from leaking out to ClientRequestS= tate - instead it's possible to log the query MemTracker by following paren= t links in the MemTracker=2E This patch is partially based on Joe McDonnel= l's IMPALA-1575 patch=2E Testing: Ran core tests=2E Change-Id: I41ff374b0= 403f10a145f7fee9b3145953ee32341 --- M be/src/runtime/coordinator=2Ecc M be/= src/runtime/coordinator=2Eh M be/src/runtime/mem-tracker=2Ecc M be/src/runt= ime/mem-tracker=2Eh M be/src/runtime/query-exec-mgr=2Ecc M be/src/runtime/q= uery-state=2Ecc M be/src/runtime/query-state=2Eh M be/src/runtime/runtime-s= tate=2Ecc M be/src/runtime/test-env=2Ecc M be/src/service/client-request-st= ate=2Ecc 10 files changed, 122 insertions(+), 85 deletions(-) git pull = ssh://gerrit=2Ecloudera=2Eorg:29418/Impala-ASF refs/changes/03/8303/9 -- T= o view, visit http://gerrit=2Ecloudera=2Eorg:8080/8303 To unsubscribe, visi= t http://gerrit=2Ecloudera=2Eorg:8080/settings Gerrit-Project: Impala-ASF = Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I41= ff374b0403f10a145f7fee9b3145953ee32341 Gerrit-Change-Number: 8303 Gerrit-Pa= tchSet: 9 Gerrit-Owner: Tim Armstrong Gerrit-Re= viewer: Joe McDonnell --k7xFYCw8ubI=--