jerqi commented on code in PR #1146:
URL: 
https://github.com/apache/incubator-uniffle/pull/1146#discussion_r1378336404


##########
client-spark/spark2/src/main/java/org/apache/spark/shuffle/RssShuffleManager.java:
##########
@@ -125,6 +126,11 @@ public class RssShuffleManager extends 
RssShuffleManagerBase {
   private boolean rssResubmitStage;
   /** A list of shuffleServer for Write failures */
   private Set<String> failuresShuffleServerIds = Sets.newHashSet();
+  /**
+   * Prevent multiple tasks from reporting FetchFailed, resulting in multiple 
ShuffleServer
+   * assignments, stageID, Attemptnumber Whether to reallocate the combination 
flag;
+   */
+  private Map<String, Boolean> preventDoubleAllocationFlag = 
JavaUtils.newConcurrentMap();

Review Comment:
   `serverAssignedInfos`?



##########
client-spark/spark3/src/main/java/org/apache/spark/shuffle/RssShuffleManager.java:
##########
@@ -136,6 +137,11 @@ public class RssShuffleManager extends 
RssShuffleManagerBase {
   private boolean rssResubmitStage;
   /** A list of shuffleServer for Write failures */
   private Set<String> failuresShuffleServerIds;
+  /**
+   * Prevent multiple tasks from reporting FetchFailed, resulting in multiple 
ShuffleServer
+   * assignments, stageID, Attemptnumber Whether to reallocate the combination 
flag;
+   */
+  private Map<String, Boolean> preventDoubleAllocationFlag;

Review Comment:
   serverAssignedInfos?



##########
client-spark/spark3/src/main/java/org/apache/spark/shuffle/RssShuffleManager.java:
##########
@@ -1104,4 +1112,78 @@ private ShuffleHandleInfo getRemoteShuffleHandleInfo(int 
shuffleId) {
   public void addFailuresShuffleServerInfos(String shuffleServerId) {
     failuresShuffleServerIds.add(shuffleServerId);
   }
+
+  /**
+   * Reassign the ShuffleServer list for ShuffleId
+   *
+   * @param shuffleId
+   * @param numPartitions
+   */
+  @Override
+  public synchronized boolean reassignShuffleServers(
+      int stageId, int stageAttemptNumber, int shuffleId, int numPartitions) {
+    String stageIdAndAttempt = stageId + "_" + stageAttemptNumber;
+    Boolean reallocationFlag =
+        preventDoubleAllocationFlag.computeIfAbsent(stageIdAndAttempt, id -> 
false);
+    if (!reallocationFlag) {

Review Comment:
   `reallocationFlag` -> `needReassign`?



##########
internal-client/src/main/java/org/apache/uniffle/client/impl/grpc/ShuffleManagerGrpcClient.java:
##########
@@ -105,4 +107,12 @@ public RssReportShuffleWriteFailureResponse 
reportShuffleWriteFailure(
       throw new RssException(msg, e);
     }
   }
+
+  @Override
+  public RssReassignServersReponse 
reallocationShuffleServers(RssReassignServersRequest req) {

Review Comment:
   `realloctionShuffleServers` -> `reassignShuffleServers`?



##########
proto/src/main/proto/Rss.proto:
##########
@@ -501,6 +501,8 @@ service ShuffleManager {
   rpc getPartitionToShufflerServer(PartitionToShuffleServerRequest) returns 
(PartitionToShuffleServerResponse);
   // Report write failures to ShuffleManager
   rpc reportShuffleWriteFailure (ReportShuffleWriteFailureRequest) returns 
(ReportShuffleWriteFailureResponse);
+  // Reallocate the RPC interface of the ShuffleServer list

Review Comment:
   `Reallocate` -> `Reassign`?



##########
client-spark/spark2/src/main/java/org/apache/spark/shuffle/RssShuffleManager.java:
##########
@@ -806,4 +812,79 @@ private ShuffleHandleInfo getRemoteShuffleHandleInfo(int 
shuffleId) {
   public void addFailuresShuffleServerInfos(String shuffleServerId) {
     failuresShuffleServerIds.add(shuffleServerId);
   }
+
+  /**
+   * Reassign the ShuffleServer list for ShuffleId
+   *
+   * @param shuffleId
+   * @param numPartitions
+   */
+  @Override
+  public synchronized boolean reassignShuffleServers(
+      int stageId, int stageAttemptNumber, int shuffleId, int numPartitions) {
+    String stageIdAndAttempt = stageId + "_" + stageAttemptNumber;
+    Boolean reassignFlag =

Review Comment:
   `reassignFlag` -> `needReassgin`



##########
internal-client/src/main/java/org/apache/uniffle/client/response/RssReassignServersReponse.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.uniffle.client.response;
+
+import org.apache.uniffle.common.rpc.StatusCode;
+import org.apache.uniffle.proto.RssProtos;
+
+public class RssReassignServersReponse extends ClientResponse {
+
+  private boolean reallocationFlag;

Review Comment:
   `rellactionFlag` -> `needReassign`?



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


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

Reply via email to