dongjoon-hyun commented on a change in pull request #24966: [SPARK-28157][CORE] 
Make SHS clear KVStore LogInfo for the expired blacklist entries
URL: https://github.com/apache/spark/pull/24966#discussion_r297315719
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala
 ##########
 @@ -177,7 +177,17 @@ private[history] class FsHistoryProvider(conf: SparkConf, 
clock: Clock)
    */
   private def clearBlacklist(expireTimeInSeconds: Long): Unit = {
     val expiredThreshold = clock.getTimeMillis() - expireTimeInSeconds * 1000
-    blacklist.asScala.retain((_, creationTime) => creationTime >= 
expiredThreshold)
+    blacklist.asScala.retain { (fileName, creationTime) =>
+      val isCleared = creationTime >= expiredThreshold
+      if (isCleared) {
+        // For the permission-only changes, the file size will be the same.
+        // Without clearing the entry, `shouldReloadLog` returns false at file 
size comparison.
+        val key = fs.getFileStatus(new Path(logDir + "/" + 
fileName)).getPath.toString
+        logInfo(s"Clear the existing log info for $key")
+        listing.delete(classOf[LogInfo], key)
 
 Review comment:
   That sounds better. Thanks!

----------------------------------------------------------------
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