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 8ADDC200D61 for ; Tue, 19 Dec 2017 20:22:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 895D4160BFF; Tue, 19 Dec 2017 19:22:05 +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 CF234160C2B for ; Tue, 19 Dec 2017 20:22:04 +0100 (CET) Received: (qmail 45888 invoked by uid 500); 19 Dec 2017 19:22:04 -0000 Mailing-List: contact issues-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@spark.apache.org Received: (qmail 45879 invoked by uid 99); 19 Dec 2017 19:22:04 -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; Tue, 19 Dec 2017 19:22:04 +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 64F4A1A077F for ; Tue, 19 Dec 2017 19:22:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 2_84Z57lX35s for ; Tue, 19 Dec 2017 19:22:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 744205F23E for ; Tue, 19 Dec 2017 19:22:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id B1F1CE0140 for ; Tue, 19 Dec 2017 19:22:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 700F5212F8 for ; Tue, 19 Dec 2017 19:22:00 +0000 (UTC) Date: Tue, 19 Dec 2017 19:22:00 +0000 (UTC) From: "Sean Owen (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (SPARK-22828) Data corruption happens when same RDD being repeatedly used as parent RDD of a custom RDD which reads each parent RDD in concurrent threads MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 19 Dec 2017 19:22:05 -0000 [ https://issues.apache.org/jira/browse/SPARK-22828?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sean Owen updated SPARK-22828: ------------------------------ Target Version/s: (was: 2.2.0) Labels: (was: spark) > Data corruption happens when same RDD being repeatedly used as parent RDD of a custom RDD which reads each parent RDD in concurrent threads > ------------------------------------------------------------------------------------------------------------------------------------------- > > Key: SPARK-22828 > URL: https://issues.apache.org/jira/browse/SPARK-22828 > Project: Spark > Issue Type: Bug > Components: Spark Core > Affects Versions: 2.1.0 > Reporter: Yongqin Xiao > > I have defined a custom RDD that > - computes the output based on input data using our traditional data transformation code. To give an extreme example, this custom RDD can behave as a union, joiner etc. > - takes one or more parent RDDs as input, where some or all parent RDDs can be the same > - reads input parent RDDs in concurrent threads (i.e. reader threads) > - computes the data in one or more transformation thread that concurrently running as the reader threads > - ... > In certain cases, we see{color:red} data being corrupted{color} when our reader threads read them in. The corruption happens when all of the following conditions are met: > - Multiple parent RDDs of the custom RDD are actually the same RDD. e.g. same-source union. > {code:java} > The scala code is kind of like this: > Rdd rdd1 = ... > Rdd customRdd = new MyRdd(rdd1, rdd1, ...) > {code} > - The parent RDD is not a result of repartitioning or sorting-within-partition. > - There is no persistence on the same parent RDD. > - spark.sql.shuffle.partitions is set to 1. We saw corruption as well when the value is set to small value like 2, which is also the source partition count. > This data corruption happens even when number of executors and cores are set to 1. Meaning this corruption is not related to multiple partitions running concurrently. > Data corruption doesn't happen when either of the condition is met: > 1. Instead of setting the same parent RDD as multiple input to my custom RDD, we do a select (of all columns) operation on that parent RDD, and use different select RDD as input. > {code:java} > The scala code is like this: > Rdd rdd1 = ... > Rdd customRdd = new MyRdd(rdd1.select($1,$2,...), rdd1.select($1, $2), ...) > {code} > 2. we persist the parent RDD > {code:java} > Rdd rdd1 = ... > rdd1.persist(...) > Rdd customRdd = MyRdd(rdd1, rdd1, ...) > {code} > 3. we use single thread to read parent RDD in custom RDD implementation > 4. Use our default value (100) for spark.sql.shuffle.partitions -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org