This is an automated email from the ASF dual-hosted git repository.

angerszhuuuu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git


The following commit(s) were added to refs/heads/main by this push:
     new bfce6052d [CELEBORN-560][FOLLOWUP] Follow the original design for 
handling rerun & speculative task after handleStageEnd   (#1468)
bfce6052d is described below

commit bfce6052d7a905996c9bcc0c2fe7900dc9bfc780
Author: Angerszhuuuu <[email protected]>
AuthorDate: Fri Apr 28 11:18:42 2023 +0800

    [CELEBORN-560][FOLLOWUP] Follow the original design for handling rerun & 
speculative task after handleStageEnd   (#1468)
---
 .../main/java/org/apache/celeborn/client/ShuffleClientImpl.java   | 3 ++-
 .../main/scala/org/apache/celeborn/client/LifecycleManager.scala  | 6 ++++++
 .../celeborn/common/meta/ShufflePartitionLocationInfo.scala       | 8 ++++++++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git 
a/client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java 
b/client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java
index f11ffea5f..745f04a8b 100644
--- a/client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java
+++ b/client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java
@@ -650,8 +650,9 @@ public class ShuffleClientImpl extends ShuffleClient {
     }
 
     // get location
+    // If rerun or speculation task running after LifecycleManager call 
stageEnd,
+    // register shuffle will return an empty location map, client need revive 
for a new location.
     if (!map.containsKey(partitionId)) {
-      logger.warn("It should never reach here!");
       if (!revive(
           applicationId,
           shuffleId,
diff --git 
a/client/src/main/scala/org/apache/celeborn/client/LifecycleManager.scala 
b/client/src/main/scala/org/apache/celeborn/client/LifecycleManager.scala
index 05138549a..832521979 100644
--- a/client/src/main/scala/org/apache/celeborn/client/LifecycleManager.scala
+++ b/client/src/main/scala/org/apache/celeborn/client/LifecycleManager.scala
@@ -568,6 +568,12 @@ class LifecycleManager(appId: String, val conf: 
CelebornConf) extends RpcEndpoin
     }
 
     if (commitManager.tryFinalCommit(shuffleId)) {
+      // Here we only clear PartitionLocation info in shuffleAllocatedWorkers.
+      // Since rerun or speculation task may running after we handle StageEnd.
+      workerSnapshots(shuffleId).asScala.foreach { case (_, 
partitionLocationInfo) =>
+        partitionLocationInfo.removeAllMasterPartitions()
+        partitionLocationInfo.removeAllSlavePartitions()
+      }
       requestMasterReleaseSlots(
         ReleaseSlots(applicationId, shuffleId, List.empty.asJava, 
List.empty.asJava))
     }
diff --git 
a/common/src/main/scala/org/apache/celeborn/common/meta/ShufflePartitionLocationInfo.scala
 
b/common/src/main/scala/org/apache/celeborn/common/meta/ShufflePartitionLocationInfo.scala
index 1a4f6d2b4..b40bc2917 100644
--- 
a/common/src/main/scala/org/apache/celeborn/common/meta/ShufflePartitionLocationInfo.scala
+++ 
b/common/src/main/scala/org/apache/celeborn/common/meta/ShufflePartitionLocationInfo.scala
@@ -57,6 +57,14 @@ class ShufflePartitionLocationInfo {
     slavePartitionLocations.containsKey(partitionId)
   }
 
+  def removeAllMasterPartitions(): Unit = {
+    masterPartitionLocations.clear()
+  }
+
+  def removeAllSlavePartitions(): Unit = {
+    slavePartitionLocations.clear()
+  }
+
   def removeMasterPartitions(partitionId: Int): util.Set[PartitionLocation] = {
     removePartitions(masterPartitionLocations, partitionId)
   }

Reply via email to