[jira] [Commented] (SPARK-3032) Potential bug when running sort-based shuffle with sorting using TimSort
[ https://issues.apache.org/jira/browse/SPARK-3032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14152014#comment-14152014 ] Matei Zaharia commented on SPARK-3032: -- Yup, this will appear in 1.1.1. I've merged it into branch-1.1 already if you want to try it. Potential bug when running sort-based shuffle with sorting using TimSort Key: SPARK-3032 URL: https://issues.apache.org/jira/browse/SPARK-3032 Project: Spark Issue Type: Bug Components: Shuffle Affects Versions: 1.1.0 Reporter: Saisai Shao Assignee: Saisai Shao Priority: Blocker Fix For: 1.1.1, 1.2.0 When using SparkPerf's aggregate-by-key workload to test sort-based shuffle, data type for key and value is (String, String), always meet this issue: {noformat} java.lang.IllegalArgumentException: Comparison method violates its general contract! at org.apache.spark.util.collection.Sorter$SortState.mergeLo(Sorter.java:755) at org.apache.spark.util.collection.Sorter$SortState.mergeAt(Sorter.java:493) at org.apache.spark.util.collection.Sorter$SortState.mergeCollapse(Sorter.java:420) at org.apache.spark.util.collection.Sorter$SortState.access$200(Sorter.java:294) at org.apache.spark.util.collection.Sorter.sort(Sorter.java:128) at org.apache.spark.util.collection.SizeTrackingPairBuffer.destructiveSortedIterator(SizeTrackingPairBuffer.scala:83) at org.apache.spark.util.collection.ExternalSorter.spillToMergeableFile(ExternalSorter.scala:323) at org.apache.spark.util.collection.ExternalSorter.spill(ExternalSorter.scala:271) at org.apache.spark.util.collection.ExternalSorter.maybeSpill(ExternalSorter.scala:249) at org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:220) at org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:85) at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68) at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41) at org.apache.spark.scheduler.Task.run(Task.scala:54) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:199) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) {noformat} Seems the current partitionKeyComparator which use hashcode of String as key comparator break some sorting contracts. Also I tested using data type Int as key, this is OK to pass the test, since hashcode of Int is its self. So I think potentially partitionDiff + hashcode of String may break the sorting contracts. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-3032) Potential bug when running sort-based shuffle with sorting using TimSort
[ https://issues.apache.org/jira/browse/SPARK-3032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14148411#comment-14148411 ] Andrew Ash commented on SPARK-3032: --- This bug prevents people from doing testing of sort-based shuffle on the rest of the 1.1.x series. Is this a good candidate for a backport to 1.1 ? Potential bug when running sort-based shuffle with sorting using TimSort Key: SPARK-3032 URL: https://issues.apache.org/jira/browse/SPARK-3032 Project: Spark Issue Type: Bug Components: Shuffle Affects Versions: 1.1.0 Reporter: Saisai Shao Assignee: Saisai Shao Priority: Blocker When using SparkPerf's aggregate-by-key workload to test sort-based shuffle, data type for key and value is (String, String), always meet this issue: {noformat} java.lang.IllegalArgumentException: Comparison method violates its general contract! at org.apache.spark.util.collection.Sorter$SortState.mergeLo(Sorter.java:755) at org.apache.spark.util.collection.Sorter$SortState.mergeAt(Sorter.java:493) at org.apache.spark.util.collection.Sorter$SortState.mergeCollapse(Sorter.java:420) at org.apache.spark.util.collection.Sorter$SortState.access$200(Sorter.java:294) at org.apache.spark.util.collection.Sorter.sort(Sorter.java:128) at org.apache.spark.util.collection.SizeTrackingPairBuffer.destructiveSortedIterator(SizeTrackingPairBuffer.scala:83) at org.apache.spark.util.collection.ExternalSorter.spillToMergeableFile(ExternalSorter.scala:323) at org.apache.spark.util.collection.ExternalSorter.spill(ExternalSorter.scala:271) at org.apache.spark.util.collection.ExternalSorter.maybeSpill(ExternalSorter.scala:249) at org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:220) at org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:85) at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68) at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41) at org.apache.spark.scheduler.Task.run(Task.scala:54) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:199) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) {noformat} Seems the current partitionKeyComparator which use hashcode of String as key comparator break some sorting contracts. Also I tested using data type Int as key, this is OK to pass the test, since hashcode of Int is its self. So I think potentially partitionDiff + hashcode of String may break the sorting contracts. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-3032) Potential bug when running sort-based shuffle with sorting using TimSort
[ https://issues.apache.org/jira/browse/SPARK-3032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14145887#comment-14145887 ] Apache Spark commented on SPARK-3032: - User 'jerryshao' has created a pull request for this issue: https://github.com/apache/spark/pull/2514 Potential bug when running sort-based shuffle with sorting using TimSort Key: SPARK-3032 URL: https://issues.apache.org/jira/browse/SPARK-3032 Project: Spark Issue Type: Bug Components: Shuffle Affects Versions: 1.1.0 Reporter: Saisai Shao Assignee: Saisai Shao Priority: Critical When using SparkPerf's aggregate-by-key workload to test sort-based shuffle, data type for key and value is (String, String), always meet this issue: {noformat} java.lang.IllegalArgumentException: Comparison method violates its general contract! at org.apache.spark.util.collection.Sorter$SortState.mergeLo(Sorter.java:755) at org.apache.spark.util.collection.Sorter$SortState.mergeAt(Sorter.java:493) at org.apache.spark.util.collection.Sorter$SortState.mergeCollapse(Sorter.java:420) at org.apache.spark.util.collection.Sorter$SortState.access$200(Sorter.java:294) at org.apache.spark.util.collection.Sorter.sort(Sorter.java:128) at org.apache.spark.util.collection.SizeTrackingPairBuffer.destructiveSortedIterator(SizeTrackingPairBuffer.scala:83) at org.apache.spark.util.collection.ExternalSorter.spillToMergeableFile(ExternalSorter.scala:323) at org.apache.spark.util.collection.ExternalSorter.spill(ExternalSorter.scala:271) at org.apache.spark.util.collection.ExternalSorter.maybeSpill(ExternalSorter.scala:249) at org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:220) at org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:85) at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68) at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41) at org.apache.spark.scheduler.Task.run(Task.scala:54) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:199) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) {noformat} Seems the current partitionKeyComparator which use hashcode of String as key comparator break some sorting contracts. Also I tested using data type Int as key, this is OK to pass the test, since hashcode of Int is its self. So I think potentially partitionDiff + hashcode of String may break the sorting contracts. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-3032) Potential bug when running sort-based shuffle with sorting using TimSort
[ https://issues.apache.org/jira/browse/SPARK-3032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14143792#comment-14143792 ] Aaron Davidson commented on SPARK-3032: --- [~matei] any thoughts on this issue? Potential bug when running sort-based shuffle with sorting using TimSort Key: SPARK-3032 URL: https://issues.apache.org/jira/browse/SPARK-3032 Project: Spark Issue Type: Bug Components: Shuffle Affects Versions: 1.1.0 Reporter: Saisai Shao When using SparkPerf's aggregate-by-key workload to test sort-based shuffle, data type for key and value is (String, String), always meet this issue: {noformat} java.lang.IllegalArgumentException: Comparison method violates its general contract! at org.apache.spark.util.collection.Sorter$SortState.mergeLo(Sorter.java:755) at org.apache.spark.util.collection.Sorter$SortState.mergeAt(Sorter.java:493) at org.apache.spark.util.collection.Sorter$SortState.mergeCollapse(Sorter.java:420) at org.apache.spark.util.collection.Sorter$SortState.access$200(Sorter.java:294) at org.apache.spark.util.collection.Sorter.sort(Sorter.java:128) at org.apache.spark.util.collection.SizeTrackingPairBuffer.destructiveSortedIterator(SizeTrackingPairBuffer.scala:83) at org.apache.spark.util.collection.ExternalSorter.spillToMergeableFile(ExternalSorter.scala:323) at org.apache.spark.util.collection.ExternalSorter.spill(ExternalSorter.scala:271) at org.apache.spark.util.collection.ExternalSorter.maybeSpill(ExternalSorter.scala:249) at org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:220) at org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:85) at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68) at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41) at org.apache.spark.scheduler.Task.run(Task.scala:54) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:199) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) {noformat} Seems the current partitionKeyComparator which use hashcode of String as key comparator break some sorting contracts. Also I tested using data type Int as key, this is OK to pass the test, since hashcode of Int is its self. So I think potentially partitionDiff + hashcode of String may break the sorting contracts. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-3032) Potential bug when running sort-based shuffle with sorting using TimSort
[ https://issues.apache.org/jira/browse/SPARK-3032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14144244#comment-14144244 ] Matei Zaharia commented on SPARK-3032: -- Yeah actually I'm sure TimSort works fine with a partial ordering, I read through the contract of Comparable. We also use it that way all the time when we only sort by partition ID. Potential bug when running sort-based shuffle with sorting using TimSort Key: SPARK-3032 URL: https://issues.apache.org/jira/browse/SPARK-3032 Project: Spark Issue Type: Bug Components: Shuffle Affects Versions: 1.1.0 Reporter: Saisai Shao Assignee: Saisai Shao Priority: Critical When using SparkPerf's aggregate-by-key workload to test sort-based shuffle, data type for key and value is (String, String), always meet this issue: {noformat} java.lang.IllegalArgumentException: Comparison method violates its general contract! at org.apache.spark.util.collection.Sorter$SortState.mergeLo(Sorter.java:755) at org.apache.spark.util.collection.Sorter$SortState.mergeAt(Sorter.java:493) at org.apache.spark.util.collection.Sorter$SortState.mergeCollapse(Sorter.java:420) at org.apache.spark.util.collection.Sorter$SortState.access$200(Sorter.java:294) at org.apache.spark.util.collection.Sorter.sort(Sorter.java:128) at org.apache.spark.util.collection.SizeTrackingPairBuffer.destructiveSortedIterator(SizeTrackingPairBuffer.scala:83) at org.apache.spark.util.collection.ExternalSorter.spillToMergeableFile(ExternalSorter.scala:323) at org.apache.spark.util.collection.ExternalSorter.spill(ExternalSorter.scala:271) at org.apache.spark.util.collection.ExternalSorter.maybeSpill(ExternalSorter.scala:249) at org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:220) at org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:85) at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68) at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41) at org.apache.spark.scheduler.Task.run(Task.scala:54) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:199) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) {noformat} Seems the current partitionKeyComparator which use hashcode of String as key comparator break some sorting contracts. Also I tested using data type Int as key, this is OK to pass the test, since hashcode of Int is its self. So I think potentially partitionDiff + hashcode of String may break the sorting contracts. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-3032) Potential bug when running sort-based shuffle with sorting using TimSort
[ https://issues.apache.org/jira/browse/SPARK-3032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14144243#comment-14144243 ] Matei Zaharia commented on SPARK-3032: -- I'm not completely sure that this is because hashCode provides a partial ordering, because I believe TimSort is supposed to work on partial orderings as well. I believe the problem is an integer over flow when we subtract key1.hashCode - key2.hashCode. Can you try replacing the line that returns h1 - h2 in keyComparator with returning Integer.compare(h1, h2)? This will properly deal with overflow. Returning h1 - h2 is definitely wrong: for example suppose that h1 = Int.MaxValue and h2 = Int.MinValue, then h1 - h2 = -1. Please add a unit test for this case as well. Potential bug when running sort-based shuffle with sorting using TimSort Key: SPARK-3032 URL: https://issues.apache.org/jira/browse/SPARK-3032 Project: Spark Issue Type: Bug Components: Shuffle Affects Versions: 1.1.0 Reporter: Saisai Shao Priority: Critical When using SparkPerf's aggregate-by-key workload to test sort-based shuffle, data type for key and value is (String, String), always meet this issue: {noformat} java.lang.IllegalArgumentException: Comparison method violates its general contract! at org.apache.spark.util.collection.Sorter$SortState.mergeLo(Sorter.java:755) at org.apache.spark.util.collection.Sorter$SortState.mergeAt(Sorter.java:493) at org.apache.spark.util.collection.Sorter$SortState.mergeCollapse(Sorter.java:420) at org.apache.spark.util.collection.Sorter$SortState.access$200(Sorter.java:294) at org.apache.spark.util.collection.Sorter.sort(Sorter.java:128) at org.apache.spark.util.collection.SizeTrackingPairBuffer.destructiveSortedIterator(SizeTrackingPairBuffer.scala:83) at org.apache.spark.util.collection.ExternalSorter.spillToMergeableFile(ExternalSorter.scala:323) at org.apache.spark.util.collection.ExternalSorter.spill(ExternalSorter.scala:271) at org.apache.spark.util.collection.ExternalSorter.maybeSpill(ExternalSorter.scala:249) at org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:220) at org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:85) at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68) at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41) at org.apache.spark.scheduler.Task.run(Task.scala:54) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:199) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) {noformat} Seems the current partitionKeyComparator which use hashcode of String as key comparator break some sorting contracts. Also I tested using data type Int as key, this is OK to pass the test, since hashcode of Int is its self. So I think potentially partitionDiff + hashcode of String may break the sorting contracts. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-3032) Potential bug when running sort-based shuffle with sorting using TimSort
[ https://issues.apache.org/jira/browse/SPARK-3032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14144258#comment-14144258 ] Saisai Shao commented on SPARK-3032: Hi Matei, thanks for your reply, I will try again using your comments. Potential bug when running sort-based shuffle with sorting using TimSort Key: SPARK-3032 URL: https://issues.apache.org/jira/browse/SPARK-3032 Project: Spark Issue Type: Bug Components: Shuffle Affects Versions: 1.1.0 Reporter: Saisai Shao Assignee: Saisai Shao Priority: Critical When using SparkPerf's aggregate-by-key workload to test sort-based shuffle, data type for key and value is (String, String), always meet this issue: {noformat} java.lang.IllegalArgumentException: Comparison method violates its general contract! at org.apache.spark.util.collection.Sorter$SortState.mergeLo(Sorter.java:755) at org.apache.spark.util.collection.Sorter$SortState.mergeAt(Sorter.java:493) at org.apache.spark.util.collection.Sorter$SortState.mergeCollapse(Sorter.java:420) at org.apache.spark.util.collection.Sorter$SortState.access$200(Sorter.java:294) at org.apache.spark.util.collection.Sorter.sort(Sorter.java:128) at org.apache.spark.util.collection.SizeTrackingPairBuffer.destructiveSortedIterator(SizeTrackingPairBuffer.scala:83) at org.apache.spark.util.collection.ExternalSorter.spillToMergeableFile(ExternalSorter.scala:323) at org.apache.spark.util.collection.ExternalSorter.spill(ExternalSorter.scala:271) at org.apache.spark.util.collection.ExternalSorter.maybeSpill(ExternalSorter.scala:249) at org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:220) at org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:85) at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68) at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41) at org.apache.spark.scheduler.Task.run(Task.scala:54) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:199) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) {noformat} Seems the current partitionKeyComparator which use hashcode of String as key comparator break some sorting contracts. Also I tested using data type Int as key, this is OK to pass the test, since hashcode of Int is its self. So I think potentially partitionDiff + hashcode of String may break the sorting contracts. -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org