You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Ivan Dyptan (Jira)" <ji...@apache.org> on 2019/11/25 11:11:01 UTC

[jira] [Comment Edited] (SPARK-18105) LZ4 failed to decompress a stream of shuffled data

    [ https://issues.apache.org/jira/browse/SPARK-18105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16981442#comment-16981442 ] 

Ivan Dyptan edited comment on SPARK-18105 at 11/25/19 11:10 AM:
----------------------------------------------------------------

You can recreate the error consistently by forcing disk spill on shuffle:
 # Run spark-shell with minimum memory
 `./bin/spark-shell --master yarn  --executor-memory 1g --num-executors 1`
 # Create two large tables, at least ~10M records
 # Join them together

{code:java}
// code placeholder
val people0 = spark.read.orc("/tmp/people/people0.orc").select("ID", "ln").sortWithinPartitions("ID")val people1 = spark.read.orc("/tmp/people/people1.orc").select("ID", "fn").sortWithinPartitions("ID")people0.join(people1, Seq("ID")).write.parquet("/tmp/people/joined")

{code}
Tested with Spark 2.4.0


was (Author: dyptan):
You can recreate the error consistently by forcing disk spill on shuffle:
 # Run spark-shell with minimum memory
`./bin/spark-shell --master yarn  --executor-memory 1g --num-executors 1`
 # Create two large tables, at least ~10M records
 # Join them together

{color:#172b4d}{{val people0 = spark.read.{color:#172b4d}orc{color}({color:#36b37e}"/tmp/people/people0.orc"{color}).{color:#172b4d}select{color}({color:#36b37e}"ID"{color}, {color:#36b37e}"{color}{color:#36b37e}ln"{color}).{color:#172b4d}sortWithinPartitions{color}({color:#36b37e}"ID"{color})val people1 = spark.read.{color:#172b4d}orc{color}({color:#36b37e}"/tmp/people/people1.orc"{color}).{color:#172b4d}select{color}({color:#36b37e}"ID"{color}, {color:#36b37e}"fn"{color}).{color:#172b4d}sortWithinPartitions{color}({color:#36b37e}"ID"{color})people0.{color:#172b4d}join{color}(people1, {color:#6554c0}Seq{color}({color:#36b37e}"ID"{color})).write.{color:#172b4d}parquet{color}({color:#36b37e}"/tmp/people/joined"{color})}}{color}

Tested with Spark 2.4.0

> LZ4 failed to decompress a stream of shuffled data
> --------------------------------------------------
>
>                 Key: SPARK-18105
>                 URL: https://issues.apache.org/jira/browse/SPARK-18105
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core
>            Reporter: Davies Liu
>            Assignee: Davies Liu
>            Priority: Major
>
> When lz4 is used to compress the shuffle files, it may fail to decompress it as "stream is corrupt"
> {code}
> Caused by: org.apache.spark.SparkException: Job aborted due to stage failure: Task 92 in stage 5.0 failed 4 times, most recent failure: Lost task 92.3 in stage 5.0 (TID 16616, 10.0.27.18): java.io.IOException: Stream is corrupted
> 	at org.apache.spark.io.LZ4BlockInputStream.refill(LZ4BlockInputStream.java:220)
> 	at org.apache.spark.io.LZ4BlockInputStream.available(LZ4BlockInputStream.java:109)
> 	at java.io.BufferedInputStream.read(BufferedInputStream.java:353)
> 	at java.io.DataInputStream.read(DataInputStream.java:149)
> 	at com.google.common.io.ByteStreams.read(ByteStreams.java:828)
> 	at com.google.common.io.ByteStreams.readFully(ByteStreams.java:695)
> 	at org.apache.spark.sql.execution.UnsafeRowSerializerInstance$$anon$3$$anon$1.next(UnsafeRowSerializer.scala:127)
> 	at org.apache.spark.sql.execution.UnsafeRowSerializerInstance$$anon$3$$anon$1.next(UnsafeRowSerializer.scala:110)
> 	at scala.collection.Iterator$$anon$13.next(Iterator.scala:372)
> 	at scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
> 	at org.apache.spark.util.CompletionIterator.next(CompletionIterator.scala:30)
> 	at org.apache.spark.InterruptibleIterator.next(InterruptibleIterator.scala:43)
> 	at scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
> 	at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIterator.sort_addToSorter$(Unknown Source)
> 	at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIterator.processNext(Unknown Source)
> 	at org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
> 	at org.apache.spark.sql.execution.WholeStageCodegenExec$$anonfun$8$$anon$1.hasNext(WholeStageCodegenExec.scala:370)
> 	at org.apache.spark.sql.execution.datasources.DynamicPartitionWriterContainer.writeRows(WriterContainer.scala:397)
> 	at org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelationCommand$$anonfun$run$1$$anonfun$apply$mcV$sp$1.apply(InsertIntoHadoopFsRelationCommand.scala:143)
> 	at org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelationCommand$$anonfun$run$1$$anonfun$apply$mcV$sp$1.apply(InsertIntoHadoopFsRelationCommand.scala:143)
> 	at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:70)
> 	at org.apache.spark.scheduler.Task.run(Task.scala:86)
> 	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:274)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 	at java.lang.Thread.run(Thread.java:745)
> {code}
> https://github.com/jpountz/lz4-java/issues/89



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org