Ngone51 commented on a change in pull request #25670: [SPARK-28869][CORE] Roll 
over event log files
URL: https://github.com/apache/spark/pull/25670#discussion_r328684993
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala
 ##########
 @@ -758,12 +752,15 @@ private[history] class FsHistoryProvider(conf: 
SparkConf, clock: Clock)
         invalidateUI(app.info.id, app.attempts.head.info.attemptId)
         addListing(app)
         listing.write(LogInfo(logPath.toString(), scanTime, LogType.EventLogs, 
Some(app.info.id),
-          app.attempts.head.info.attemptId, fileStatus.getLen()))
+          app.attempts.head.info.attemptId, reader.fileSizeForLastIndex,
+          reader.lastIndex, reader.completed))
 
         // For a finished log, remove the corresponding "in progress" entry 
from the listing DB if
         // the file is really gone.
-        if (appCompleted) {
-          val inProgressLog = logPath.toString() + 
EventLoggingListener.IN_PROGRESS
+        // The logic is only valid for single event log, as root path doesn't 
change for
+        // rolled event logs.
+        if (appCompleted && reader.lastIndex.isDefined) {
 
 Review comment:
   So, shouldn't it be `reader.lastIndex.isEmpty` ?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to