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


##########
client-spark/spark2/src/main/java/org/apache/spark/shuffle/RssShuffleManager.java:
##########
@@ -806,4 +812,80 @@ 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 needReassgin = 
serverAssignedInfos.computeIfAbsent(stageIdAndAttempt, id -> false);
+    if (!needReassgin) {
+      String storageType = 
sparkConf.get(RssSparkConfig.RSS_STORAGE_TYPE.key());
+      RemoteStorageInfo defaultRemoteStorage =
+          new 
RemoteStorageInfo(sparkConf.get(RssSparkConfig.RSS_REMOTE_STORAGE_PATH.key(), 
""));
+      RemoteStorageInfo remoteStorage =
+          ClientUtils.fetchRemoteStorage(
+              appId, defaultRemoteStorage, dynamicConfEnabled, storageType, 
shuffleWriteClient);
+      Set<String> assignmentTags = 
RssSparkShuffleUtils.getAssignmentTags(sparkConf);
+      ClientUtils.validateClientType(clientType);
+      assignmentTags.add(clientType);
+      int requiredShuffleServerNumber =
+          RssSparkShuffleUtils.getRequiredShuffleServerNumber(sparkConf);
+      long retryInterval = 
sparkConf.get(RssSparkConfig.RSS_CLIENT_ASSIGNMENT_RETRY_INTERVAL);
+      int retryTimes = 
sparkConf.get(RssSparkConfig.RSS_CLIENT_ASSIGNMENT_RETRY_TIMES);
+      int estimateTaskConcurrency = 
RssSparkShuffleUtils.estimateTaskConcurrency(sparkConf);
+      /** Before reassigning ShuffleServer, clear the ShuffleServer list in 
ShuffleWriteClient. */
+      shuffleWriteClient.unregisterShuffle(appId, shuffleId);

Review Comment:
   > When cleaning up at this time, some tasks are reading this data. Will this 
have any impact?
   
   Write failures are handled here, and read cases should not be involved.



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