HeartSaVioR commented on a change in pull request #26416: [SPARK-29779][CORE] 
Compact old event log files and cleanup
URL: https://github.com/apache/spark/pull/26416#discussion_r357450065
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/deploy/history/EventLogFileReaders.scala
 ##########
 @@ -173,7 +173,8 @@ class SingleFileEventLogFileReader(
 
   override def fileSizeForLastIndex: Long = status.getLen
 
-  override def completed: Boolean = 
!rootPath.getName.endsWith(EventLogFileWriter.IN_PROGRESS)
+  override def completed: Boolean = 
!rootPath.getName.stripSuffix(EventLogFileWriter.COMPACTED)
 
 Review comment:
   We prevent such situation via restriction on configuration; max file to 
retain cannot be set to 0 which means we will don't try to compact the last 
file which might be in progress file.
   
   Actually allowing to set it to 0 is bad for completed log as well, as you 
may lose everything on compaction - most of the cases all jobs should be 
finished.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to