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 C3D5F200CDD for ; Mon, 7 Aug 2017 23:10:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C297516288C; Mon, 7 Aug 2017 21:10:14 +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 149E31625A8 for ; Mon, 7 Aug 2017 23:10:13 +0200 (CEST) Received: (qmail 94150 invoked by uid 500); 7 Aug 2017 21:10:13 -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 94138 invoked by uid 99); 7 Aug 2017 21:10:13 -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; Mon, 07 Aug 2017 21:10:13 +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 84C9CC0385 for ; Mon, 7 Aug 2017 21:10:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.362 X-Spam-Level: X-Spam-Status: No, score=0.362 tagged_above=-999 required=6.31 tests=[RDNS_DYNAMIC=0.363, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id WpB_oDW8a9Gv for ; Mon, 7 Aug 2017 21:10:07 +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 7A00C61B56 for ; Mon, 7 Aug 2017 21:10:04 +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 v77LA2aT011440; Mon, 7 Aug 2017 21:10:02 GMT Message-Id: <201708072110.v77LA2aT011440@ip-10-146-233-104.ec2.internal> Date: Mon, 7 Aug 2017 21:10:02 +0000 From: "Tim Armstrong (Code Review)" To: Matthew Jacobs , impala-cr@cloudera.com, reviews@impala.incubator.apache.org CC: Henry Robinson , Michael Ho 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: 43a5bb12a4f9108602c9087a06bf16f2dd641f01 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: Mon, 07 Aug 2017 21:10:15 -0000 Hello 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 (#4). 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/buffered-block-mgr.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/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 20 files changed, 122 insertions(+), 86 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/92/7492/4 -- 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: 4 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