SteNicholas commented on code in PR #3834:
URL: https://github.com/apache/celeborn/pull/3834#discussion_r4258712697


##########
client-spark/spark-3/src/test/scala/org/apache/spark/shuffle/celeborn/CelebornShuffleManagerSuite.scala:
##########
@@ -92,6 +92,70 @@ class SparkShuffleManagerSuite extends Logging {
     sc.stop()
   }
 
+  @junit.Test
+  def testReliableStorageFollowsFallbackPolicy(): Unit = {
+    // supportsReliableStorage must be true only for NEVER; AUTO/ALWAYS may 
fall back to local-disk
+    // shuffle, so reporting reliable storage would let DRA reclaim executors 
holding fallback data.
+    def reliable(policy: String): Boolean = {
+      val conf = new SparkConf(false)
+        .set(s"spark.${CelebornConf.SPARK_SHUFFLE_FALLBACK_POLICY.key}", 
policy)
+      new CelebornShuffleDataIO(conf).driver()
+        
.asInstanceOf[CelebornShuffleDriverComponents].supportsReliableStorage()
+    }
+    Assert.assertTrue(reliable("NEVER"))
+    Assert.assertFalse(reliable("AUTO"))
+    Assert.assertFalse(reliable("ALWAYS"))
+    Assert.assertFalse(
+      new CelebornShuffleDataIO(new SparkConf(false)).driver()
+        
.asInstanceOf[CelebornShuffleDriverComponents].supportsReliableStorage())
+  }
+
+  @junit.Test
+  def testUnsafeDraFallback(): Unit = {
+    for {
+      dra <- Seq(false, true)
+      shuffleService <- Seq(false, true)
+      tracking <- Seq(false, true)
+      decommission <- Seq(false, true)
+      shuffleBlocks <- Seq(false, true)
+    } {
+      val conf = new SparkConf(false)
+        .set("spark.dynamicAllocation.enabled", dra.toString)
+        .set("spark.shuffle.service.enabled", shuffleService.toString)
+        .set("spark.dynamicAllocation.shuffleTracking.enabled", 
tracking.toString)
+        .set("spark.decommission.enabled", decommission.toString)
+        .set("spark.storage.decommission.shuffleBlocks.enabled", 
shuffleBlocks.toString)
+      val decommissionSupported = SparkVersionUtil.isGreaterThan(3, 0)
+      val expected = dra && !shuffleService && !tracking &&
+        !(decommissionSupported && decommission && shuffleBlocks)
+      Assert.assertEquals(conf.toDebugString, expected, 
SparkShuffleManager.isUnsafeDraFallback(conf))

Review Comment:
   @venkata91, apply the formatter to unblock CI. This assertion fails the 
project's Spotless check: the formatter expects the call to be split across 
multiple lines. The current [style 
check](https://github.com/apache/celeborn/actions/runs/34889029285/job/115149935707)
 and [Spark 3.5 Maven 
job](https://github.com/apache/celeborn/actions/runs/34889029379/job/115149937317)
 both stop on this violation before the Spark tests run. Please apply the 
project formatter and rerun the formatting check.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to