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-27590][CORE] do not consider skipped tasks when scheduling speculative tasks #24485

Closed
wants to merge 3 commits into from

Conversation

cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

This is a followup of #24375

When TaskSetManager skips a task because its corresponding partition is already completed by other TaskSetManagers, we should not consider the duration of the task that is finished by other TaskSetManagers to schedule the speculative tasks of this TaskSetManager.

How was this patch tested?

updated test case

@cloud-fan
Copy link
Contributor Author

cc @squito @jiangxb1987

@SparkQA
Copy link

SparkQA commented Apr 29, 2019

Test build #104986 has finished for PR 24485 at commit 203e65e.

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

Copy link
Contributor

@squito squito left a comment

Choose a reason for hiding this comment

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

lgtm, just a small suggestion on a cleanup

// `successfulTaskDurations` may not equal to `tasksSuccessful`. Here we should only count the
// tasks that are submitted by this `TaskSetManager` and are completed successfully.
val numSuccessfulTasks = successfulTaskDurations.size()
if (numSuccessfulTasks >= minFinishedForSpeculation && numSuccessfulTasks > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

unrelated to your change, but a potential cleanup here -- why not compute minFinishedForSpeculation in the construction, and even set it to math.max(1, (speculationQuantile * numTasks).floor.toInt)? Then you also don't need the extra numSuccessfulTasks > 0 here.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@jiangxb1987
Copy link
Contributor

LGTM

@SparkQA
Copy link

SparkQA commented May 6, 2019

Test build #105143 has finished for PR 24485 at commit 9606410.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented May 6, 2019

Test build #105150 has finished for PR 24485 at commit 9606410.

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

@@ -1032,14 +1032,14 @@ private[spark] class TaskSetManager(
return false
}
var foundTasks = false
val minFinishedForSpeculation = (speculationQuantile * numTasks).floor.toInt
val minFinishedForSpeculation = math.max((speculationQuantile * numTasks).floor.toInt, 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

sorry I had actually meant to just compute this once in the constructor, eg. around line 70

@SparkQA
Copy link

SparkQA commented May 6, 2019

Test build #105160 has finished for PR 24485 at commit 5386ab1.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented May 7, 2019

Test build #105186 has finished for PR 24485 at commit 115c072.

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

@squito
Copy link
Contributor

squito commented May 7, 2019

merged to master. Thanks @cloud-fan !

@asfgit asfgit closed this in d124ce9 May 7, 2019
@cloud-fan
Copy link
Contributor Author

@squito thanks for the review and merge!

Sign up for free to 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.

4 participants