You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by GitBox <gi...@apache.org> on 2023/01/16 03:27:16 UTC

[GitHub] [incubator-uniffle] advancedxy commented on a diff in pull request #470: [ISSUE-468] Put unavailable servers to the end of the list when sending shuffle data

advancedxy commented on code in PR #470:
URL: https://github.com/apache/incubator-uniffle/pull/470#discussion_r1070780483


##########
client/src/main/java/org/apache/uniffle/client/impl/ShuffleWriteClientImpl.java:
##########
@@ -246,6 +259,12 @@ public SendShuffleDataResult sendShuffleData(String appId, List<ShuffleBlockInfo
     // which is minimum number when there is at most *replicaWrite - replica* sending server failures.
     for (ShuffleBlockInfo sbi : shuffleBlockInfoList) {
       List<ShuffleServerInfo> allServers = sbi.getShuffleServerInfos();
+      if (replica > 1 && !shuffleServerBlacklist.isEmpty()) {
+        // We can't modify allServers directly, because allServers is shared and is not thread safe
+        List<ShuffleServerInfo> newServerList = new ArrayList<>(allServers);

Review Comment:
   This is a critical path and we are paying `copying the shuffle server then reordering the shuffle server` for every shuffle send request. Is it possible leverage the `shuffleServerBlackList` in the `genServerToBlocks` method?
   
   P.S.: to be more inclusive, we may replace `shuffleServerBlackList` to `shuffleServerBlockList`.



##########
client/src/main/java/org/apache/uniffle/client/impl/ShuffleWriteClientImpl.java:
##########
@@ -311,6 +330,17 @@ public SendShuffleDataResult sendShuffleData(String appId, List<ShuffleBlockInfo
     return new SendShuffleDataResult(successBlockIds, failedBlockIds);
   }
 
+  @VisibleForTesting
+  void moveBlacklistServersToTheEnd(List<ShuffleServerInfo> serverInfos) {

Review Comment:
   I noticed that some unit test refers this method. If possible, I would like to make this method a static one: `static moveBlacklistServersToTheEnd(List<ShuffleServerInfo> serverInfos, Set<ShuffleServerInfo> shuffleServerBlockList)`, and unit test this method. 
   
   However, if you refactor the `genServerToBlocks`, this method might be removed. 



-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org