Return-Path: X-Original-To: apmail-flink-issues-archive@minotaur.apache.org Delivered-To: apmail-flink-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 941801805F for ; Wed, 10 Feb 2016 19:07:18 +0000 (UTC) Received: (qmail 32356 invoked by uid 500); 10 Feb 2016 19:07:18 -0000 Delivered-To: apmail-flink-issues-archive@flink.apache.org Received: (qmail 32309 invoked by uid 500); 10 Feb 2016 19:07:18 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 32283 invoked by uid 99); 10 Feb 2016 19:07:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Feb 2016 19:07:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 27C062C1F58 for ; Wed, 10 Feb 2016 19:07:18 +0000 (UTC) Date: Wed, 10 Feb 2016 19:07:18 +0000 (UTC) From: "Greg Hogan (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (FLINK-3385) Fix outer join skipping unprobed partitions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Greg Hogan created FLINK-3385: --------------------------------- Summary: Fix outer join skipping unprobed partitions Key: FLINK-3385 URL: https://issues.apache.org/jira/browse/FLINK-3385 Project: Flink Issue Type: Bug Components: Distributed Runtime Reporter: Greg Hogan Priority: Critical Fix For: 1.0.0 {{MutableHashTable.nextRecord}} performs three steps for a build-side outer join: {code} public boolean nextRecord() throws IOException { if (buildSideOuterJoin) { return processProbeIter() || processUnmatchedBuildIter() || prepareNextPartition(); } else { return processProbeIter() || prepareNextPartition(); } } {code} {{MutableHashTable.processUnmatchedBuildIter}} eventually calls through to {{MutableHashTable.moveToNextBucket}} which is unable to process spilled partitions: {code} if (p.isInMemory()) { ... } else { return false; } {code} {{MutableHashTable.prepareNextPartition}} calls {{HashPartition.finalizeProbePhase}} which only spills the partition (to be read and processed in the next instantiation of {{MutableHashTable}}) if probe-side records were spilled. In an equi-join this is fine but with an outer join the unmatched build-side records must still be retained (though no further probing is necessary, so could this be short-circuited when loaded by the next {{MutableHashTable}}?). {code} if (isInMemory()) { ... } else if (this.probeSideRecordCounter == 0) { // partition is empty, no spilled buffers // return the memory buffer freeMemory.add(this.probeSideBuffer.getCurrentSegment()); // delete the spill files this.probeSideChannel.close(); this.buildSideChannel.deleteChannel(); this.probeSideChannel.deleteChannel(); return 0; } else { // flush the last probe side buffer and register this partition as pending this.probeSideBuffer.close(); this.probeSideChannel.close(); spilledPartitions.add(this); return 1; } {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)