Skip to content

[SPARK-23053][CORE][BRANCH-2.1] taskBinarySerialization and task partitions calculate in DagScheduler.submitMissingTasks should keep the same RDD checkpoint status - #20635

Closed
ivoson wants to merge 1 commit into
apache:branch-2.1from
ivoson:branch-2.1-23053

Conversation

@ivoson

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR backports #20244

When we run concurrent jobs using the same rdd which is marked to do checkpoint. If one job has finished running the job, and start the process of RDD.doCheckpoint, while another job is submitted, then submitStage and submitMissingTasks will be called. In submitMissingTasks, will serialize taskBinaryBytes and calculate task partitions which are both affected by the status of checkpoint, if the former is calculated before doCheckpoint finished, while the latter is calculated after doCheckpoint finished, when run task, rdd.compute will be called, for some rdds with particular partition type such as UnionRDD who will do partition type cast, will get a ClassCastException because the part params is actually a CheckpointRDDPartition.
This error occurs because rdd.doCheckpoint occurs in the same thread that called sc.runJob, while the task serialization occurs in the DAGSchedulers event loop.

How was this patch tested?

the exist tests.

…late in DagScheduler.submitMissingTasks should keep the same RDD checkpoint status
When we run concurrent jobs using the same rdd which is marked to do checkpoint. If one job has finished running the job, and start the process of RDD.doCheckpoint, while another job is submitted, then submitStage and submitMissingTasks will be called. In [submitMissingTasks](https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala#L961), will serialize taskBinaryBytes and calculate task partitions which are both affected by the status of checkpoint, if the former is calculated before doCheckpoint finished, while the latter is calculated after doCheckpoint finished, when run task, rdd.compute will be called, for some rdds with particular partition type such as [UnionRDD](https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/rdd/UnionRDD.scala) who will do partition type cast, will get a ClassCastException because the part params is actually a CheckpointRDDPartition.
This error occurs because rdd.doCheckpoint occurs in the same thread that called sc.runJob, while the task serialization occurs in the DAGSchedulers event loop.
the exist uts and also add a test case in DAGScheduerSuite to show the exception case.
Author: huangtengfei <huangtengfei@huangtengfeideMacBook-Pro.local>
Closesapache#20244 from ivoson/branch-taskpart-mistype.
Change-Id: I634009d51ae40336e9d0717d061213ff7e36e71f
@ivoson

Copy link
Copy Markdown
ContributorAuthor

cc @squito

@squito

Copy link
Copy Markdown
Contributor

Jenkins, Ok to test

@squito

Copy link
Copy Markdown
Contributor

lgtm assuming tests pass

@SparkQA

Copy link
Copy Markdown

Test build #4102 has finished for PR 20635 at commit bd88903.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

asfgit pushed a commit that referenced this pull request Feb 21, 2018
…itions calculate in DagScheduler.submitMissingTasks should keep the same RDD checkpoint status
## What changes were proposed in this pull request?
This PR backports [#20244](#20244)
When we run concurrent jobs using the same rdd which is marked to do checkpoint. If one job has finished running the job, and start the process of RDD.doCheckpoint, while another job is submitted, then submitStage and submitMissingTasks will be called. In [submitMissingTasks](https://github.com/apache/spark/blob/branch-2.1/core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala#L932), will serialize taskBinaryBytes and calculate task partitions which are both affected by the status of checkpoint, if the former is calculated before doCheckpoint finished, while the latter is calculated after doCheckpoint finished, when run task, rdd.compute will be called, for some rdds with particular partition type such as [UnionRDD](https://github.com/apache/spark/blob/branch-2.1/core/src/main/scala/org/apache/spark/rdd/UnionRDD.scala) who will do partition type cast, will get a ClassCastException because the part params is actually a CheckpointRDDPartition.
This error occurs because rdd.doCheckpoint occurs in the same thread that called sc.runJob, while the task serialization occurs in the DAGSchedulers event loop.
## How was this patch tested?
the exist tests.
Author: huangtengfei <huangtengfei@huangtengfeideMacBook-Pro.local>
Closes#20635 from ivoson/branch-2.1-23053.
@squito

Copy link
Copy Markdown
Contributor

thanks @ivoson , merged!

@ivoson

Copy link
Copy Markdown
ContributorAuthor

thanks for reviewing this @squito

@vanzinvanzin mentioned this pull request May 11, 2018
@ivoson
ivoson deleted the branch-2.1-23053 branch June 4, 2018 03:16
zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 22, 2025
Closesapache#20458Closesapache#20530Closesapache#20557Closesapache#20966Closesapache#20857Closesapache#19694Closesapache#18227Closesapache#20683Closesapache#20881Closesapache#20347Closesapache#20825Closesapache#20078Closesapache#21281Closesapache#19951Closesapache#20905Closesapache#20635
Author: Sean Owen <srowen@gmail.com>
Closesapache#21303 from srowen/ClosePRs.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ivoson@squito@SparkQA