You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by brkyvz <gi...@git.apache.org> on 2015/10/30 07:37:43 UTC

[GitHub] spark pull request: [SPARK-11419][STREAMING] Parallel recovery for...

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

    https://github.com/apache/spark/pull/9373#discussion_r43475449
  
    --- Diff: streaming/src/main/scala/org/apache/spark/streaming/util/FileBasedWriteAheadLog.scala ---
    @@ -149,27 +150,26 @@ private[streaming] class FileBasedWriteAheadLog(
         val oldLogFiles = synchronized { pastLogs.filter { _.endTime < threshTime } }
         logInfo(s"Attempting to clear ${oldLogFiles.size} old log files in $logDirectory " +
           s"older than $threshTime: ${oldLogFiles.map { _.path }.mkString("\n")}")
    -
    -    def deleteFiles() {
    -      oldLogFiles.foreach { logInfo =>
    -        try {
    -          val path = new Path(logInfo.path)
    -          val fs = HdfsUtils.getFileSystemForPath(path, hadoopConf)
    -          fs.delete(path, true)
    -          synchronized { pastLogs -= logInfo }
    -          logDebug(s"Cleared log file $logInfo")
    -        } catch {
    -          case ex: Exception =>
    -            logWarning(s"Error clearing write ahead log file $logInfo", ex)
    -        }
    +    synchronized { pastLogs --= oldLogFiles }
    --- End diff --
    
    I have a test to make sure that even if the delete is not successful, the recovery is robust, and will delete the file once the next cleanup request is sent


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org