Github user tdas commented on a diff in the pull request:
https://github.com/apache/spark/pull/9143#discussion_r43971355
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceivedBlockTracker.scala
---
@@ -157,9 +166,12 @@ private[streaming] class ReceivedBlockTracker(
require(cleanupThreshTime.milliseconds < clock.getTimeMillis())
val timesToCleanup = timeToAllocatedBlocks.keys.filter { _ <
cleanupThreshTime }.toSeq
logInfo("Deleting batches " + timesToCleanup)
- writeToLog(BatchCleanupEvent(timesToCleanup))
- timeToAllocatedBlocks --= timesToCleanup
- writeAheadLogOption.foreach(_.clean(cleanupThreshTime.milliseconds,
waitForCompletion))
+ if (writeToLog(BatchCleanupEvent(timesToCleanup))) {
+ timeToAllocatedBlocks --= timesToCleanup
+ writeAheadLogOption.foreach(_.clean(cleanupThreshTime.milliseconds,
waitForCompletion))
--- End diff --
Why will it never get cleaned up? If any of the future attempts with higher
cleanupThreshTime than the current one, will clean up older files.
BTW, even if you call `WAL.clean` before `timeToAllocatedBlocks --=
timesToCleanup`, if `waitForCompletion = false` (which is the case in
production), then the files are going to be deleted asynchronously and there
are not guarantees anyway.
So I dont see much of a difference in moving them around.
---
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]