diff options
author | jinxing <jinxing@meituan.com> | 2017-02-18 10:49:40 -0400 |
---|---|---|
committer | Kay Ousterhout <kayousterhout@gmail.com> | 2017-02-18 10:55:18 -0400 |
commit | 729ce3703257aa34c00c5c8253e6971faf6a0c8d (patch) | |
tree | 4282d3c039e09a5e66e6ca9377dd4989fd79b928 /sql/core/src/main/scala/org | |
parent | 21c7d3c31a7078f730a62e53a6252caa7fe7b338 (diff) | |
download | spark-729ce3703257aa34c00c5c8253e6971faf6a0c8d.tar.gz spark-729ce3703257aa34c00c5c8253e6971faf6a0c8d.tar.bz2 spark-729ce3703257aa34c00c5c8253e6971faf6a0c8d.zip |
[SPARK-19263] DAGScheduler should avoid sending conflicting task set.
In current `DAGScheduler handleTaskCompletion` code, when event.reason is `Success`, it will first do `stage.pendingPartitions -= task.partitionId`, which maybe a bug when `FetchFailed` happens.
**Think about below**
1. Stage 0 runs and generates shuffle output data.
2. Stage 1 reads the output from stage 0 and generates more shuffle data. It has two tasks: ShuffleMapTask1 and ShuffleMapTask2, and these tasks are launched on executorA.
3. ShuffleMapTask1 fails to fetch blocks locally and sends a FetchFailed to the driver. The driver marks executorA as lost and updates failedEpoch;
4. The driver resubmits stage 0 so the missing output can be re-generated, and then once it completes, resubmits stage 1 with ShuffleMapTask1x and ShuffleMapTask2x.
5. ShuffleMapTask2 (from the original attempt of stage 1) successfully finishes on executorA and sends Success back to driver. This causes DAGScheduler::handleTaskCompletion to remove partition 2 from stage.pendingPartitions (line 1149), but it does not add the partition to the set of output locations (line 1192), because the task’s epoch is less than the failure epoch for the executor (because of the earlier failure on executor A)
6. ShuffleMapTask1x successfully finishes on executorB, causing the driver to remove partition 1 from stage.pendingPartitions. Combined with the previous step, this means that there are no more pending partitions for the stage, so the DAGScheduler marks the stage as finished (line 1196). However, the shuffle stage is not available (line 1215) because the completion for ShuffleMapTask2 was ignored because of its epoch, so the DAGScheduler resubmits the stage.
7. ShuffleMapTask2x is still running, so when TaskSchedulerImpl::submitTasks is called for the re-submitted stage, it throws an error, because there’s an existing active task set
**In this fix**
If a task completion is from a previous stage attempt and the epoch is too low
(i.e., it was from a failed executor), don't remove the corresponding partition
from pendingPartitions.
Author: jinxing <jinxing@meituan.com>
Author: jinxing <jinxing6042@126.com>
Closes #16620 from jinxing64/SPARK-19263.
Diffstat (limited to 'sql/core/src/main/scala/org')
0 files changed, 0 insertions, 0 deletions