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 8C106200CDE for ; Tue, 8 Aug 2017 17:08:02 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8A779167671; Tue, 8 Aug 2017 15:08:02 +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 C9FA3167670 for ; Tue, 8 Aug 2017 17:08:01 +0200 (CEST) Received: (qmail 37440 invoked by uid 500); 8 Aug 2017 15:08:01 -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 37429 invoked by uid 99); 8 Aug 2017 15:08:00 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2017 15:08:00 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 47E8AC0166 for ; Tue, 8 Aug 2017 15:08:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-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 (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id gquNf5tVwQLw for ; Tue, 8 Aug 2017 15:07:59 +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 DDBE35FB57 for ; Tue, 8 Aug 2017 15:07:58 +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 v78F7vMa025623; Tue, 8 Aug 2017 15:07:57 GMT Message-Id: <201708081507.v78F7vMa025623@ip-10-146-233-104.ec2.internal> Date: Tue, 8 Aug 2017 15:07:57 +0000 From: "Tim Armstrong (Code Review)" To: Michael Ho , Matthew Jacobs , impala-cr@cloudera.com, reviews@impala.incubator.apache.org CC: Henry Robinson Reply-To: tarmstrong@cloudera.com X-Gerrit-MessageType: newpatchset Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-5715=3A_=28mitigation_only=29_defer_destruction_of_MemTrackers=0A?= X-Gerrit-Change-Id: I205abb0076d1ffd08cb93c0f1671c8b81e7fba0f X-Gerrit-ChangeURL: X-Gerrit-Commit: 3ca2d4b517c2adb7771d0e47a20ec7e3452206b3 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.7 archived-at: Tue, 08 Aug 2017 15:08:02 -0000 Hello Michael Ho, Matthew Jacobs, I'd like you to reexamine a change. Please visit http://gerrit.cloudera.org:8080/7492 to look at the new patch set (#5). Change subject: IMPALA-5715: (mitigation only) defer destruction of MemTrackers ...................................................................... IMPALA-5715: (mitigation only) defer destruction of MemTrackers One potential candidate for the bad MemTracker IMPALA-5715 is one owned by a join build sink. I haven't found a clear root cause, but we can reduce the probability of bugs like this by deferring teardown of the MemTrackers. This patch defers destruction of the fragment instance, ExecNode, DataSink and Codegen MemTrackers until query teardown. Instead MemTracker::Close() is called at the place where the MemTracker would have been destroyed to check that all memory is released and enforce that no more memory is consumed. The entire query MemTracker subtree is then disconnected in whole from the global tree in QueryState::ReleaseResources(), instead of the MemTrackers being incrementally disconnected bottom-up. In cases where the MemTracker is owned by another object, this required deferring teardown of the owner until query teardown. E.g. for LlvmCodeGen I added a Close() method to release resources and deferred calling the destructor. We want to make this change anyway - see IMPALA-5587. Testing: Ran a core ASAN build. Change-Id: I205abb0076d1ffd08cb93c0f1671c8b81e7fba0f --- M be/src/codegen/llvm-codegen-test.cc M be/src/codegen/llvm-codegen.cc M be/src/codegen/llvm-codegen.h M be/src/exec/data-sink.cc M be/src/exec/exchange-node.cc M be/src/exec/exec-node.cc M be/src/exec/nested-loop-join-node.cc M be/src/exprs/expr-codegen-test.cc M be/src/runtime/bufferpool/reservation-tracker-test.cc M be/src/runtime/coordinator.cc M be/src/runtime/coordinator.h M be/src/runtime/data-stream-recvr.cc M be/src/runtime/disk-io-mgr.cc M be/src/runtime/initial-reservations.cc M be/src/runtime/initial-reservations.h M be/src/runtime/mem-tracker.cc M be/src/runtime/mem-tracker.h M be/src/runtime/query-state.cc M be/src/runtime/runtime-filter-bank.cc M be/src/runtime/runtime-state.cc M be/src/runtime/runtime-state.h 21 files changed, 144 insertions(+), 102 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/92/7492/5 -- To view, visit http://gerrit.cloudera.org:8080/7492 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I205abb0076d1ffd08cb93c0f1671c8b81e7fba0f Gerrit-PatchSet: 5 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Tim Armstrong Gerrit-Reviewer: Henry Robinson Gerrit-Reviewer: Matthew Jacobs Gerrit-Reviewer: Michael Ho Gerrit-Reviewer: Tim Armstrong