You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by lins05 <gi...@git.apache.org> on 2017/04/04 14:57:16 UTC
[GitHub] spark pull request #17088: [SPARK-19753][CORE] Un-register all shuffle outpu...
Github user lins05 commented on a diff in the pull request:
https://github.com/apache/spark/pull/17088#discussion_r109682527
--- Diff: core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala ---
@@ -394,6 +394,68 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with Timeou
assertDataStructuresEmpty()
}
+ test("All shuffle files should on the slave should be cleaned up when slave lost") {
+ // reset the test context with the right shuffle service config
+ afterEach()
+ val conf = new SparkConf()
+ conf.set("spark.shuffle.service.enabled", "true")
+ init(conf)
+ runEvent(ExecutorAdded("exec-hostA1", "hostA"))
+ runEvent(ExecutorAdded("exec-hostA2", "hostA"))
+ runEvent(ExecutorAdded("exec-hostB", "hostB"))
+ val firstRDD = new MyRDD(sc, 3, Nil)
+ val firstShuffleDep = new ShuffleDependency(firstRDD, new HashPartitioner(3))
+ val firstShuffleId = firstShuffleDep.shuffleId
+ val shuffleMapRdd = new MyRDD(sc, 3, List(firstShuffleDep))
+ val shuffleDep = new ShuffleDependency(shuffleMapRdd, new HashPartitioner(3))
+ val reduceRdd = new MyRDD(sc, 1, List(shuffleDep))
+ submit(reduceRdd, Array(0))
+ // map stage1 completes successfully, with one task on each executor
+ complete(taskSets(0), Seq(
+ (Success,
+ MapStatus(BlockManagerId("exec-hostA1", "hostA", 12345), Array.fill[Long](1)(2))),
+ (Success,
+ MapStatus(BlockManagerId("exec-hostA2", "hostA", 12345), Array.fill[Long](1)(2))),
+ (Success, makeMapStatus("hostB", 1))
+ ))
+ // map stage2 completes successfully, with one task on each executor
+ complete(taskSets(1), Seq(
+ (Success,
+ MapStatus(BlockManagerId("exec-hostA1", "hostA", 12345), Array.fill[Long](1)(2))),
+ (Success,
+ MapStatus(BlockManagerId("exec-hostA2", "hostA", 12345), Array.fill[Long](1)(2))),
+ (Success, makeMapStatus("hostB", 1))
+ ))
+ // make sure our test setup is correct
+ val initialMapStatus1 = mapOutputTracker.mapStatuses.get(0).get
+ assert(initialMapStatus1.count(_ != null) === 3)
+ assert(initialMapStatus1.map{_.location.executorId}.toSet ===
+ Set("exec-hostA1", "exec-hostA2", "exec-hostB"))
+
+ val initialMapStatus2 = mapOutputTracker.mapStatuses.get(0).get
+ assert(initialMapStatus2.count(_ != null) === 3)
+ assert(initialMapStatus2.map{_.location.executorId}.toSet ===
+ Set("exec-hostA1", "exec-hostA2", "exec-hostB"))
+
+ // reduce stage fails with a fetch failure from one host
+ complete(taskSets(2), Seq(
+ (FetchFailed(BlockManagerId("exec-hostA2", "hostA", 12345), firstShuffleId, 0, 0, "ignored"),
--- End diff --
Seems the `FetchFailed` message should reference `shuffleDep.shuffleId` instead of `firstShuffleId`?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org