HeartSaVioR 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_r331314726
##########
File path:
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala
##########
@@ -1165,12 +1161,15 @@ private[history] case class LogInfo(
logType: LogType.Value,
appId: Option[String],
attemptId: Option[String],
- fileSize: Long)
+ fileSize: Long,
+ lastIndex: Option[Long],
Review comment:
I've crafted some test code to experiment this:
```
val newLogDir = new
File("/spark-dist/releases/spark-2.4.4-bin-hadoop2.7/eventlogs")
val localStoreDir = new
File("/spark-dist/releases/spark-2.4.4-bin-hadoop2.7/history-dir")
val newLocalStoreDir = new File(testDir, "localstore")
newLocalStoreDir.mkdirs()
FileUtils.copyDirectory(localStoreDir, newLocalStoreDir)
val conf = createTestConf()
conf.set(HISTORY_LOG_DIR, newLogDir.getAbsolutePath)
conf.set(LOCAL_STORE_DIR, newLocalStoreDir.getAbsolutePath)
val provider = new FsHistoryProvider(conf)
provider.checkForLogs()
```
Here the directory directly points to the eventlogs/history local store
directory in Spark 2.4.4 since metadata of listing contains the path and Spark
ignores the content of local store if metadata doesn't match. If we want to
include this to new UT, some modification might be needed. We tend to add UT if
we want to ensure the new change is compatible with old version, so seem to be
worth to add.
I've set breakpoint to `FsHistoryProvider.checkForLogs`, and observed
lastIndex is set to `None` (so it seems to be safe), but `logType` is set to
`null` which we don't expect.
Would we be better to increase `CURRENT_LISTING_VERSION` to deal with this,
or manually set to `EventLogs` when it's null? Maybe better to deal with new PR
though.
----------------------------------------------------------------
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]