Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -838,9 +838,11 @@ private[spark] class BlockStatusPerBlockId {
}

def remove(blockId: BlockId): Unit = {
blocks.remove(blockId)
if (blocks.isEmpty) {
blocks = null
if (blocks != null) {
blocks.remove(blockId)
if (blocks.isEmpty) {
blocks = null
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,26 @@ class ExternalShuffleServiceSuite extends ShuffleSuite with BeforeAndAfterAll wi
}
}
}

test("SPARK-38640: memory only blocks can unpersist using shuffle service cache fetching") {
for (enabled <- Seq(true, false)) {
val confWithRddFetch =
conf.clone.set(config.SHUFFLE_SERVICE_FETCH_RDD_ENABLED, enabled)
sc = new SparkContext("local-cluster[1,1,1024]", "test", confWithRddFetch)
sc.env.blockManager.externalShuffleServiceEnabled should equal(true)
sc.env.blockManager.blockStoreClient.getClass should equal(classOf[ExternalBlockStoreClient])
try {
val rdd = sc.parallelize(0 until 100, 2)
.map { i => (i, 1) }
.persist(StorageLevel.MEMORY_ONLY)

rdd.count()
rdd.unpersist(true)
assert(sc.persistentRdds.isEmpty)
} finally {
rpcHandler.applicationRemoved(sc.conf.getAppId, true)
sc.stop()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class BlockManagerInfoSuite extends SparkFunSuite {
if (svcEnabled) {
assert(getEssBlockStatus(bmInfo, rddId).isEmpty)
}
bmInfo.updateBlockInfo(rddId, StorageLevel.NONE, memSize = 0, diskSize = 0)
assert(bmInfo.remainingMem === 30000)
}

testWithShuffleServiceOnOff("RDD block with MEMORY_AND_DISK") { (svcEnabled, bmInfo) =>
Expand Down