dingshun3016 commented on code in PR #1652:
URL:
https://github.com/apache/incubator-uniffle/pull/1652#discussion_r1573609522
##########
client-spark/common/src/main/java/org/apache/uniffle/shuffle/manager/ShuffleManagerGrpcService.java:
##########
@@ -235,16 +235,17 @@ public void reassignShuffleServers(
public void reassignFaultyShuffleServer(
RssProtos.RssReassignFaultyShuffleServerRequest request,
StreamObserver<RssProtos.RssReassignFaultyShuffleServerResponse>
responseObserver) {
- ShuffleServerInfo shuffleServerInfo =
+ ShuffleHandleInfo handle =
shuffleManager.reassignFaultyShuffleServerForTasks(
request.getShuffleId(),
Sets.newHashSet(request.getPartitionIdsList()),
- request.getFaultyShuffleServerId());
+ request.getFaultyShuffleServerId(),
+ Sets.newHashSet(request.getNeedLoadBalancePartitionIdsList()));
RssProtos.StatusCode code = RssProtos.StatusCode.SUCCESS;
RssProtos.RssReassignFaultyShuffleServerResponse reply =
RssProtos.RssReassignFaultyShuffleServerResponse.newBuilder()
.setStatus(code)
-
.setServer(ShuffleServerInfo.convertToShuffleServerId(shuffleServerInfo))
+ .setHandle(ShuffleHandleInfo.toProto(handle))
Review Comment:
There will be `ConcurrentModificationException` here, because
`org.apache.spark.shuffle.ShuffleHandleInfo#partitionReplicaAssignedServers`
will be modified by other tasks
##########
client-spark/spark3/src/main/java/org/apache/spark/shuffle/RssShuffleManager.java:
##########
@@ -1201,61 +1209,75 @@ public synchronized boolean
reassignAllShuffleServersForWholeStage(
// this is only valid on driver side that exposed to being invoked by grpc
server
@Override
- public ShuffleServerInfo reassignFaultyShuffleServerForTasks(
- int shuffleId, Set<Integer> partitionIds, String faultyShuffleServerId) {
+ public ShuffleHandleInfo reassignFaultyShuffleServerForTasks(
+ int shuffleId,
+ Set<Integer> partitionIds,
+ String faultyShuffleServerId,
+ Set<Integer> needLoadBalancePartitionIds) {
ShuffleHandleInfo handleInfo = shuffleIdToShuffleHandleInfo.get(shuffleId);
synchronized (handleInfo) {
// find out whether this server has been marked faulty in this shuffle
// if it has been reassigned, directly return the replacement server.
// otherwise, it should request new servers to reassign
- Set<ShuffleServerInfo> replacements =
- handleInfo.getExistingReplacements(faultyShuffleServerId);
+ Set<ShuffleServerInfo> replacements =
handleInfo.getReplacements(faultyShuffleServerId);
if (replacements == null) {
- replacements = requestServersForTask(shuffleId, partitionIds,
faultyShuffleServerId);
+ int requiredServerNum = 1;
+ if (CollectionUtils.isNotEmpty(needLoadBalancePartitionIds)) {
+ requiredServerNum = partitionReassignLoadBalanceServerNum;
+ }
+ Set<String> faultyServers = new
HashSet<>(handleInfo.listFaultyServers());
+ faultyServers.add(faultyShuffleServerId);
+ replacements =
+ reassignServerForTask(shuffleId, partitionIds, faultyServers,
requiredServerNum);
}
- handleInfo.updateReassignment(partitionIds, faultyShuffleServerId,
replacements);
+ handleInfo.updateAssignment(
+ partitionIds, faultyShuffleServerId, replacements,
needLoadBalancePartitionIds);
Review Comment:
Will there be any problems here in the following scenarios?
first
when task t1, partitionIds = [1,2,3] faultyShuffleServerId = s1
second
when task t2, partitionIds = [4,5,6] faultyShuffleServerId = s1
--
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]