Github user lianhuiwang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4066#discussion_r24315166
  
    --- Diff: core/src/main/scala/org/apache/spark/SparkHadoopWriter.scala ---
    @@ -105,24 +106,61 @@ class SparkHadoopWriter(@transient jobConf: JobConf)
       def commit() {
         val taCtxt = getTaskContext()
         val cmtr = getOutputCommitter()
    -    if (cmtr.needsTaskCommit(taCtxt)) {
    +
    +    // Called after we have decided to commit
    +    def performCommit(): Unit = {
           try {
             cmtr.commitTask(taCtxt)
    -        logInfo (taID + ": Committed")
    +        logInfo (s"$taID: Committed")
           } catch {
    -        case e: IOException => {
    +        case e: IOException =>
               logError("Error committing the output of task: " + taID.value, e)
               cmtr.abortTask(taCtxt)
               throw e
    +      }
    +    }
    +
    +    // First, check whether the task's output has already been committed 
by some other attempt
    +    if (cmtr.needsTaskCommit(taCtxt)) {
    +      // The task output needs to be committed, but we don't know whether 
some other task attempt
    +      // might be racing to commit the same output partition. Therefore, 
coordinate with the driver
    +      // in order to determine whether this attempt can commit.
    +      val shouldCoordinateWithDriver: Boolean = {
    +        val sparkConf = SparkEnv.get.conf
    +        // We only need to coordinate with the driver if there are 
multiple concurrent task
    +        // attempts, which should only occur if speculation is enabled
    --- End diff --
    
    yes, i think there is a possible to have multiple concurrently running task 
attempts for the same task when there are fetchFailed resultTasks and 
spark.shuffle.service.enabled = false. example: after one minute, one failed 
resultTask reports fetchFailed and DAGScheduler makes stage failedStage. then 
DAGScheduler will submit all uncompleted tasks of this result stage and some of 
uncompleted tasks have been submitted before. so at this time, it has multiple 
concurrently running task attempts for the same task. @JoshRosen @vanzin 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to