Github user andrewor14 commented on a diff in the pull request: https://github.com/apache/spark/pull/9428#discussion_r44320866 --- Diff: core/src/main/scala/org/apache/spark/rdd/ReliableRDDCheckpointData.scala --- @@ -63,11 +98,20 @@ private[spark] class ReliableRDDCheckpointData[T: ClassTag](@transient private v throw new SparkException(s"Failed to create checkpoint path $cpDir") } - // Save to file, and reload it as an RDD - val broadcastedConf = rdd.context.broadcast( - new SerializableConfiguration(rdd.context.hadoopConfiguration)) - // TODO: This is expensive because it computes the RDD again unnecessarily (SPARK-8582) - rdd.context.runJob(rdd, ReliableCheckpointRDD.writeCheckpointFile[T](cpDir, broadcastedConf) _) + val checkpointedPartitionFiles = fs.listStatus(path).map(_.getPath.getName).toSet + // Not all actions compute all partitions of the RDD (e.g. take). For correctness, we + // must checkpoint any missing partitions. TODO: avoid running another job here (SPARK-8582). + val missingPartitionIndices = rdd.partitions.map(_.index).filter { i => + !checkpointedPartitionFiles(ReliableCheckpointRDD.checkpointFileName(i)) + } + if (missingPartitionIndices.nonEmpty) { + // TODO: This is expensive because it computes the RDD again unnecessarily (SPARK-8582) --- End diff -- this TODO is outdated. This is only called when the iterator is not drained, in which case it is necessary to run another job to compute the missing partitions for correctness. I would just remove this TODO.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org