You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/11/30 19:12:51 UTC
[GitHub] [spark] holdenk commented on a change in pull request #30492: [SPARK-33545][CORE] Support Fallback Storage during Worker decommission
holdenk commented on a change in pull request #30492:
URL: https://github.com/apache/spark/pull/30492#discussion_r532827737
##########
File path: core/src/main/scala/org/apache/spark/internal/config/package.scala
##########
@@ -471,6 +471,16 @@ package object config {
"cache block replication should be positive.")
.createWithDefaultString("30s")
+ private[spark] val STORAGE_DECOMMISSION_FALLBACK_STORAGE_PATH =
+ ConfigBuilder("spark.storage.decommission.fallbackStorage.path")
+ .doc("The location for fallback storage during block manager decommissioning. " +
+ "For example, `s3a://spark-storage/`. In case of empty, fallback storage is disabled. " +
+ "The storage should be managed by TTL because Spark will not clean up it.")
Review comment:
Optional nit : “clean up it” -> “clean it up”
##########
File path: core/pom.xml
##########
@@ -461,6 +461,47 @@
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-aws</artifactId>
+ <version>${hadoop.version}</version>
+ <scope>test</scope>
Review comment:
Why is the scope only test? To use this won’t folks need Hadoop-aws?
##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManager.scala
##########
@@ -627,7 +627,16 @@ private[spark] class BlockManager(
override def getLocalBlockData(blockId: BlockId): ManagedBuffer = {
if (blockId.isShuffle) {
logDebug(s"Getting local shuffle block ${blockId}")
- shuffleManager.shuffleBlockResolver.getBlockData(blockId)
+ try {
+ shuffleManager.shuffleBlockResolver.getBlockData(blockId)
+ } catch {
+ case e: IOException =>
Review comment:
Nit/ question: Could we move the if up as part of the case and avoid the need for explicit rethrow?
##########
File path: core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala
##########
@@ -295,8 +295,9 @@ final class ShuffleBlockFetcherIterator(
var hostLocalBlockBytes = 0L
var remoteBlockBytes = 0L
+ val fallback = FallbackStorage.FALLBACK_BLOCK_MANAGER_ID.executorId
for ((address, blockInfos) <- blocksByAddress) {
- if (address.executorId == blockManager.blockManagerId.executorId) {
+ if (Seq(blockManager.blockManagerId.executorId, fallback).contains(address.executorId)) {
Review comment:
I’m fuzzy on why this change is needed, would the fallback ever be equal to the execid?
##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManager.scala
##########
@@ -627,7 +627,16 @@ private[spark] class BlockManager(
override def getLocalBlockData(blockId: BlockId): ManagedBuffer = {
if (blockId.isShuffle) {
logDebug(s"Getting local shuffle block ${blockId}")
- shuffleManager.shuffleBlockResolver.getBlockData(blockId)
+ try {
+ shuffleManager.shuffleBlockResolver.getBlockData(blockId)
+ } catch {
+ case e: IOException =>
+ if (conf.get(config.STORAGE_DECOMMISSION_FALLBACK_STORAGE_PATH).isDefined) {
+ FallbackStorage.read(conf, blockId)
+ } else {
+ throw e
+ }
Review comment:
I think this would probably fail quickly if the external storage doesn’t have the block right? So no need to do a separate check to see if the block is present, the failure message is good enough.
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org