-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-28699][Core] Fix a corner case for aborting indeterminate stage #25498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2741,27 +2741,11 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi | |
| FetchFailed(makeBlockManagerId("hostC"), shuffleId2, 0, 0, "ignored"), | ||
| null)) | ||
|
|
||
| val failedStages = scheduler.failedStages.toSeq | ||
| assert(failedStages.length == 2) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not big deal, but I think this assert still applies?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After this change, |
||
| // Shuffle blocks of "hostC" is lost, so first task of the `shuffleMapRdd2` needs to retry. | ||
| assert(failedStages.collect { | ||
| case stage: ShuffleMapStage if stage.shuffleDep.shuffleId == shuffleId2 => stage | ||
| }.head.findMissingPartitions() == Seq(0)) | ||
| // The result stage is still waiting for its 2 tasks to complete | ||
| assert(failedStages.collect { | ||
| case stage: ResultStage => stage | ||
| }.head.findMissingPartitions() == Seq(0, 1)) | ||
|
|
||
| scheduler.resubmitFailedStages() | ||
|
|
||
| // The first task of the `shuffleMapRdd2` failed with fetch failure | ||
| runEvent(makeCompletionEvent( | ||
| taskSets(3).tasks(0), | ||
| FetchFailed(makeBlockManagerId("hostA"), shuffleId1, 0, 0, "ignored"), | ||
| null)) | ||
|
|
||
| // The job should fail because Spark can't rollback the shuffle map stage. | ||
| assert(failure != null && failure.getMessage.contains("Spark cannot rollback")) | ||
| // The second shuffle map stage need to rerun, the job will abort for the indeterminate | ||
| // stage rerun. | ||
| // TODO: After we support re-generate shuffle file(SPARK-25341), this test will be extended. | ||
| assert(failure != null && failure.getMessage | ||
xuanyuanking marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| .contains("Spark cannot rollback the ShuffleMapStage 1")) | ||
| } | ||
|
|
||
| private def assertResultStageFailToRollback(mapRdd: MyRDD): Unit = { | ||
|
|
@@ -2872,6 +2856,33 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi | |
| assert(latch.await(10, TimeUnit.SECONDS)) | ||
| } | ||
|
|
||
| test("SPARK-28699: abort stage if parent stage is indeterminate stage") { | ||
| val shuffleMapRdd = new MyRDD(sc, 2, Nil, indeterminate = true) | ||
|
|
||
| val shuffleDep = new ShuffleDependency(shuffleMapRdd, new HashPartitioner(2)) | ||
| val shuffleId = shuffleDep.shuffleId | ||
| val finalRdd = new MyRDD(sc, 2, List(shuffleDep), tracker = mapOutputTracker) | ||
|
|
||
| submit(finalRdd, Array(0, 1)) | ||
|
|
||
| // Finish the first shuffle map stage. | ||
| complete(taskSets(0), Seq( | ||
| (Success, makeMapStatus("hostA", 2)), | ||
| (Success, makeMapStatus("hostB", 2)))) | ||
| assert(mapOutputTracker.findMissingPartitions(shuffleId) === Some(Seq.empty)) | ||
|
|
||
| runEvent(makeCompletionEvent( | ||
| taskSets(1).tasks(0), | ||
| FetchFailed(makeBlockManagerId("hostA"), shuffleId, 0, 0, "ignored"), | ||
| null)) | ||
|
|
||
| // Shuffle blocks of "hostA" is lost, so first task of the `shuffleMapRdd` needs to retry. | ||
| // The result stage is still waiting for its 2 tasks to complete. | ||
| // Because of shuffleMapRdd is indeterminate, this job will be abort. | ||
| assert(failure != null && failure.getMessage | ||
| .contains("Spark cannot rollback the ShuffleMapStage 0")) | ||
| } | ||
|
|
||
| test("Completions in zombie tasksets update status of non-zombie taskset") { | ||
| val parts = 4 | ||
| val shuffleMapRdd = new MyRDD(sc, parts, Nil) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.