cloud-fan commented on a change in pull request #25962: [SPARK-29285][Shuffle] 
Temporary shuffle files should be able to handle disk failures
URL: https://github.com/apache/spark/pull/25962#discussion_r340929253
 
 

 ##########
 File path: 
core/src/test/scala/org/apache/spark/storage/DiskBlockManagerSuite.scala
 ##########
 @@ -91,4 +90,43 @@ class DiskBlockManagerSuite extends SparkFunSuite with 
BeforeAndAfterEach with B
     for (i <- 0 until numBytes) writer.write(i)
     writer.close()
   }
+
+  test("temporary shuffle/local file should be able to handle disk failures") {
+    try {
+      // the following two lines pre-create subdirectories under each root dir 
of block manager
+      diskBlockManager.getFile("1")
+      diskBlockManager.getFile("2")
+
+      val tempShuffleFile1 = diskBlockManager.createTempShuffleBlock()._2
+      val tempLocalFile1 = diskBlockManager.createTempLocalBlock()._2
+      assert(tempShuffleFile1.exists(), "There are no bad disks, so temp 
shuffle file exists")
+      assert(tempLocalFile1.exists(), "There are no bad disks, so temp local 
file exists")
+
+      // partial disks damaged
+      rootDir0.setExecutable(false)
+      val tempShuffleFile2 = diskBlockManager.createTempShuffleBlock()._2
+      val tempLocalFile2 = diskBlockManager.createTempLocalBlock()._2
+      assert(tempShuffleFile2.exists(),
 
 Review comment:
   It's possible that after 10 retries we still not able to find the healthy 
disk. Can we think of how to remove the flakiness of this test?

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to