Ngone51 commented on a change in pull request #30164:
URL: https://github.com/apache/spark/pull/30164#discussion_r522121599
##########
File path: core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala
##########
@@ -1974,6 +1974,48 @@ class BlockManagerSuite extends SparkFunSuite with
Matchers with BeforeAndAfterE
}
}
+ test("Shuffle push merger locations should be bounded with in" +
+ " spark.shuffle.push.retainedMergerLocations") {
+ assert(master.getShufflePushMergerLocations(10, Set.empty).isEmpty)
+ makeBlockManager(100, "execA",
+ transferService = Some(new MockBlockTransferService(10, "hostA")))
+ makeBlockManager(100, "execB",
+ transferService = Some(new MockBlockTransferService(10, "hostB")))
+ makeBlockManager(100, "execC",
+ transferService = Some(new MockBlockTransferService(10, "hostC")))
+ makeBlockManager(100, "execD",
+ transferService = Some(new MockBlockTransferService(10, "hostD")))
+ makeBlockManager(100, "execE",
+ transferService = Some(new MockBlockTransferService(10, "hostA")))
+ assert(master.getShufflePushMergerLocations(10, Set.empty).size == 4)
+ assert(master.getShufflePushMergerLocations(10, Set.empty)
+ .exists(x => Seq("hostC", "hostD", "hostA", "hostB").contains(x.host)))
+ assert(master.getShufflePushMergerLocations(10, Set("hostB")).size == 3)
+ }
+
+ test("Prefer active executors locations for shuffle push mergers") {
+ makeBlockManager(100, "execA",
+ transferService = Some(new MockBlockTransferService(10, "hostA")))
+ makeBlockManager(100, "execB",
+ transferService = Some(new MockBlockTransferService(10, "hostB")))
+ makeBlockManager(100, "execC",
+ transferService = Some(new MockBlockTransferService(10, "hostC")))
+ makeBlockManager(100, "execD",
+ transferService = Some(new MockBlockTransferService(10, "hostD")))
+ makeBlockManager(100, "execE",
+ transferService = Some(new MockBlockTransferService(10, "hostA")))
+ assert(master.getShufflePushMergerLocations(5, Set.empty).size == 4)
+
+ master.removeExecutor("execA")
+ master.removeExecutor("execE")
+
+ assert(master.getShufflePushMergerLocations(3, Set.empty).size == 3)
Review comment:
If we want to get 4 merges, it should also include `hostA`? If yes,
shall we also test this case?
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]