Skip to content

Commit 92f3b89

Browse files
committed
[SPARK-16827] Avoid reporting spill metrics as shuffle metrics
1 parent 8d969a2 commit 92f3b89

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ private UnsafeExternalSorter(
145145
// Use getSizeAsKb (not bytes) to maintain backwards compatibility for units
146146
// this.fileBufferSizeBytes = (int) conf.getSizeAsKb("spark.shuffle.file.buffer", "32k") * 1024;
147147
this.fileBufferSizeBytes = 32 * 1024;
148-
this.writeMetrics = taskContext.taskMetrics().shuffleWriteMetrics();
148+
// The spill metrics are stored in a new ShuffleWriteMetrics, and then discarded (this fixes SPARK-16827).
149+
// TODO: Instead, separate spill metrics should be stored and reported (tracked in SPARK-3577).
150+
this.writeMetrics = new ShuffleWriteMetrics();
149151

150152
if (existingInMemorySorter == null) {
151153
this.inMemSorter = new UnsafeInMemorySorter(

0 commit comments

Comments
 (0)