Skip to content
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

[SPARK-28699][Core] Cache an indeterminate RDD could lead to incorrect result while stage rerun #25420

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,10 @@ private[spark] class DAGScheduler(

case _ =>
}

if (mapStage.findMissingPartitions().length < mapStage.numTasks) {
abortStage(mapStage, generateErrorMessage(mapStage), None)
}
}

// We expect one executor failure to trigger many FetchFailures in rapid succession,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2710,7 +2710,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi
assert(countSubmittedMapStageAttempts() === 2)
}

test("SPARK-23207: retry all the succeeding stages when the map stage is indeterminate") {
ignore("SPARK-23207: retry all the succeeding stages when the map stage is indeterminate") {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore this for the behavior change, as the approach now, we need to abort the stage of the current mapStage.
As we will finally support stage rerun, I suggest to skip this behavior, we can directly support the cache scenario after SPARK-25341 merged.

val shuffleMapRdd1 = new MyRDD(sc, 2, Nil, indeterminate = true)

val shuffleDep1 = new ShuffleDependency(shuffleMapRdd1, new HashPartitioner(2))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ case class CachedRDDBuilder(

private def buildBuffers(): RDD[CachedBatch] = {
val output = cachedPlan.output
val cached = cachedPlan.execute().mapPartitionsInternal { rowIterator =>
val cached = cachedPlan.execute().mapPartitionsWithIndexInternal({ (_, rowIterator) =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we only run cached plan once. I think it should be determinate? If so, this map should not be order sensitive effectively?

new Iterator[CachedBatch] {
def next(): CachedBatch = {
val columnBuilders = output.map { attribute =>
Expand Down Expand Up @@ -131,7 +131,7 @@ case class CachedRDDBuilder(

def hasNext: Boolean = rowIterator.hasNext
}
}.persist(storageLevel)
}, isOrderSensitive = true).persist(storageLevel)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite get it. The isOrderSensitive flag is used to describe the map function. Why the map function is order sensitive?


cached.setName(cachedName)
cached
Expand Down