Skip to content

Commit

Permalink
preserve first page in UnsafeShuffleExternalSorter
Browse files Browse the repository at this point in the history
  • Loading branch information
Davies Liu committed Aug 31, 2015
1 parent 52ea399 commit 56e746c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ public UnsafeShuffleExternalSorter(
this.maxRecordSizeBytes = pageSizeBytes - 4;
this.writeMetrics = writeMetrics;
initializeForWriting();

// preserve first page to ensure that we have at least one page to work with. Otherwise,
// other operators in the same task may starve this sorter (SPARK-9709).
acquireNewPageIfNecessary(pageSizeBytes);
}

/**
Expand Down

0 comments on commit 56e746c

Please sign in to comment.