Skip to content

Commit

Permalink
Refine
Browse files Browse the repository at this point in the history
  • Loading branch information
Liupengcheng committed Jan 17, 2019
1 parent 818379b commit 5967f11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ private[spark] class OutputCommitCoordinator(conf: SparkConf, isDriver: Boolean)
partition: Int,
attemptNumber: Int): Boolean = synchronized {
stageStates.get(stage) match {
case Some(state) if attemptInvalidOrFailed(state, stageAttempt, partition, attemptNumber) =>
case Some(state) if attemptOutdatedOrFailed(state, stageAttempt, partition, attemptNumber) =>
logInfo(s"Commit denied for stage=$stage.$stageAttempt, partition=$partition: " +
s"task attempt $attemptNumber already marked as failed.")
s"task attempt $attemptNumber already outdated or marked as failed.")
false
case Some(state) =>
val existing = state.authorizedCommitters(partition)
Expand All @@ -204,7 +204,7 @@ private[spark] class OutputCommitCoordinator(conf: SparkConf, isDriver: Boolean)
}
}

private def attemptInvalidOrFailed(
private def attemptOutdatedOrFailed(
stageState: StageState,
stageAttempt: Int,
partition: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class OutputCommitCoordinatorSuite extends SparkFunSuite with BeforeAndAfter {
outputCommitCoordinator.taskCompleted(stage, stageAttempt - 1, partition,
attemptNumber = taskAttempt,
reason = Success)
// attempts of current stage is authorized for committing
// attempts of latest retry stage is authorized for committing
assert(outputCommitCoordinator.canCommit(stage, stageAttempt, partition, taskAttempt))
}
}
Expand Down

0 comments on commit 5967f11

Please sign in to comment.