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 2BB5D200B49 for ; Wed, 20 Jul 2016 07:52:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2A732160A8B; Wed, 20 Jul 2016 05:52:45 +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 752C4160A76 for ; Wed, 20 Jul 2016 07:52:44 +0200 (CEST) Received: (qmail 14521 invoked by uid 500); 20 Jul 2016 05:52:43 -0000 Mailing-List: contact dev-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@impala.incubator.apache.org Delivered-To: mailing list dev@impala.incubator.apache.org Received: (qmail 14509 invoked by uid 99); 20 Jul 2016 05:52:43 -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; Wed, 20 Jul 2016 05:52:43 +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 9B2D11A535C for ; Wed, 20 Jul 2016 05:52:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-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-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id dIXPFngMsPwQ for ; Wed, 20 Jul 2016 05:52:40 +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 226E45F368 for ; Wed, 20 Jul 2016 05:52:40 +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 u6K5qcfj024480; Wed, 20 Jul 2016 05:52:38 GMT Message-Id: <201607200552.u6K5qcfj024480@ip-10-146-233-104.ec2.internal> Date: Wed, 20 Jul 2016 05:52:38 +0000 From: "Sailesh Mukil (Code Review)" To: Henry Robinson , impala-cr@cloudera.com, dev@impala.incubator.apache.org CC: Dan Hecht , Mostafa Mokhtar Reply-To: sailesh@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-CR=5D=28cdh5-trunk=29_IMPALA-3610=3A_Account_for_memory_used_by_filters_in_the_coordinator=0A?= X-Gerrit-Change-Id: I3c52c8a1c2e79ef370c77bf264885fc859678d1b X-Gerrit-ChangeURL: X-Gerrit-Commit: 0dc55252a33fd52aea9d089d40e71b255f26cf1a 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: Wed, 20 Jul 2016 05:52:45 -0000 Sailesh Mukil has posted comments on this change. Change subject: IMPALA-3610: Account for memory used by filters in the coordinator ...................................................................... Patch Set 2: (3 comments) http://gerrit.cloudera.org:8080/#/c/3618/2/be/src/runtime/coordinator.cc File be/src/runtime/coordinator.cc: PS2, Line 2077: state->DiscardFilter(filter_mem_tracker_.get()); Isn't this essentially a no-op, because an always_true_filter will always just consist of a NULL bloom_filter? Or can a partitioned join filter have just one ALWAYS_TRUE_FILTER (in which case this is fine, because state->bloom_filter would have been set by another update)? PS2, Line 2090: state->pending_count == 0 Wouldn't this always be 0 for a broadcast join filter? Given that we always set state->pending_count to 1 for a broadcast join filter with a remote target (in UpdateFilterRoutingTable())? Which makes this check redundant. One way to handle this is to modify the code in UpdateFilterRoutingTable() to set the pending_count to 3 (or MAX_BROADCAST_FILTER_PRODUCERS) for broadcast join filters; and change the conditional in L2065 to be: if (state->pending_count == 0 || (state->desc.is_broadcast_join && state->pending_count < MAX_BROADCAST_FILTER_PRODUCERS)) {...} But this seems a little messy and if you think of a cleaner way, that would be much better. PS2, Line 2110: for (const auto& target: state->targets) { : // Don't publish the filter to targets that are in the same fragment as the join : // that produced it. : if (target.is_local) continue; : target_fragment_instance_idxs.insert(target.fragment_instance_idxs.begin(), : target.fragment_instance_idxs.end()); : } Seems like state->targets is read only at this point, because it's set only in UpdateFilterRoutingTable() which runs before sending out the remote fragments. You could move the BloomFilter::ToThrift() before this (i.e. after L2109) and also release the filter_lock_ before running this for loop. -- To view, visit http://gerrit.cloudera.org:8080/3618 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3c52c8a1c2e79ef370c77bf264885fc859678d1b Gerrit-PatchSet: 2 Gerrit-Project: Impala Gerrit-Branch: cdh5-trunk Gerrit-Owner: Henry Robinson Gerrit-Reviewer: Dan Hecht Gerrit-Reviewer: Henry Robinson Gerrit-Reviewer: Mostafa Mokhtar Gerrit-Reviewer: Sailesh Mukil Gerrit-HasComments: Yes