Github user liyezhang556520 commented on a diff in the pull request:
https://github.com/apache/spark/pull/5886#discussion_r29731021
--- Diff:
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
@@ -186,13 +186,14 @@ private[history] class FsHistoryProvider(conf:
SparkConf, clock: Clock)
try {
val statusList = Option(fs.listStatus(new Path(logDir))).map(_.toSeq)
.getOrElse(Seq[FileStatus]())
- var newLastModifiedTime = lastModifiedTime
val logInfos: Seq[FileStatus] = statusList
.filter { entry =>
try {
getModificationTime(entry).map { time =>
- newLastModifiedTime = math.max(newLastModifiedTime, time)
- time >= lastModifiedTime
+ val fileName = entry.getPath.getName
+ val oldLastModifiedTime =
lastModifiedTimes.getOrElse(fileName, -1L)
+ lastModifiedTimes += (fileName -> time)
+ time > oldLastModifiedTime
--- End diff --
We can not use `>` to check whether the file is modified. We must use `>=`.
Since there might be modification to the file immediately after calling
`getModificationTime`, the result of which is the modified time stay the same.
We need use `>=` to check the time along with checking the file size changing.
For some discussions, please refer to
[SPARK-7189](https://issues.apache.org/jira/browse/SPARK-7189)
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]