Skip to content

Commit a53c64c

Browse files
committed
[SPARK-16827] Avoid reporting spill metrics as shuffle metrics
1 parent 050b817 commit a53c64c

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
@@ -144,7 +144,9 @@ private UnsafeExternalSorter(
144144
// Use getSizeAsKb (not bytes) to maintain backwards compatibility for units
145145
// this.fileBufferSizeBytes = (int) conf.getSizeAsKb("spark.shuffle.file.buffer", "32k") * 1024;
146146
this.fileBufferSizeBytes = 32 * 1024;
147-
this.writeMetrics = taskContext.taskMetrics().shuffleWriteMetrics();
147+
// The spill metrics are stored in a new ShuffleWriteMetrics, and then discarded (this fixes SPARK-16827).
148+
// TODO: Instead, separate spill metrics should be stored and reported (tracked in SPARK-3577).
149+
this.writeMetrics = new ShuffleWriteMetrics();
148150

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

0 commit comments

Comments
 (0)