Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-44704][CORE] Cleanup files from host node after migration due to graceful decommissioning #42391

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions core/src/main/scala/org/apache/spark/storage/BlockManager.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import org.apache.spark.errors.SparkCoreErrors
import org.apache.spark.executor.DataReadMethod
import org.apache.spark.internal.Logging
import org.apache.spark.internal.config
import org.apache.spark.internal.config.{Network, RDD_CACHE_VISIBILITY_TRACKING_ENABLED}
import org.apache.spark.internal.config.{Network, RDD_CACHE_VISIBILITY_TRACKING_ENABLED, STORAGE_DECOMMISSION_ENABLED, STORAGE_DECOMMISSION_RDD_BLOCKS_ENABLED, STORAGE_DECOMMISSION_SHUFFLE_BLOCKS_ENABLED}
import org.apache.spark.memory.{MemoryManager, MemoryMode}
import org.apache.spark.metrics.source.Source
import org.apache.spark.network._
Expand Down Expand Up @@ -193,9 +193,13 @@ private[spark] class BlockManager(
private[spark] val subDirsPerLocalDir = conf.get(config.DISKSTORE_SUB_DIRECTORIES)

val diskBlockManager = {
// Only perform cleanup if an external service is not serving our shuffle files.
// Perform cleanup if an external service is not serving our shuffle files. Also delete the
// files after migration to free up disk space.
val deleteFilesOnStop =
!externalShuffleServiceEnabled || isDriver
!externalShuffleServiceEnabled || isDriver ||
(conf.get(STORAGE_DECOMMISSION_ENABLED) &&
conf.get(STORAGE_DECOMMISSION_RDD_BLOCKS_ENABLED) &&
conf.get(STORAGE_DECOMMISSION_SHUFFLE_BLOCKS_ENABLED))
new DiskBlockManager(conf, deleteFilesOnStop = deleteFilesOnStop, isDriver = isDriver)
}

Expand Down