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


##########
client-spark/common/src/main/java/org/apache/uniffle/shuffle/manager/ShuffleManagerGrpcService.java:
##########
@@ -75,43 +79,62 @@ public void reportShuffleWriteFailure(
       code = RssProtos.StatusCode.INVALID_REQUEST;
       reSubmitWholeStage = false;
     } else {
-      Map<String, AtomicInteger> shuffleServerInfoIntegerMap = 
JavaUtils.newConcurrentMap();
+      Map<String, AtomicInteger> initServerFailures = 
JavaUtils.newConcurrentMap();
       List<ShuffleServerInfo> shuffleServerInfos =
           ShuffleServerInfo.fromProto(shuffleServerIdsList);
       shuffleServerInfos.forEach(
-          shuffleServerInfo -> {
-            shuffleServerInfoIntegerMap.put(shuffleServerInfo.getId(), new 
AtomicInteger(0));
-          });
-      ShuffleServerFailureRecord shuffleServerFailureRecord =
+          shuffleServerInfo ->
+              initServerFailures.computeIfAbsent(
+                  shuffleServerInfo.getId(), key -> new AtomicInteger(0)));
+      ShuffleServerWriterFailureRecord shuffleServerWriterFailureRecord =
           shuffleWriteStatus.computeIfAbsent(
               shuffleId,
-              key ->
-                  new ShuffleServerFailureRecord(shuffleServerInfoIntegerMap, 
stageAttemptNumber));
+              key -> new ShuffleServerWriterFailureRecord(stageAttemptNumber, 
initServerFailures));
       boolean resetflag =
-          
shuffleServerFailureRecord.resetStageAttemptIfNecessary(stageAttemptNumber);
+          
shuffleServerWriterFailureRecord.resetStageAttemptIfNecessary(stageAttemptNumber);
       if (resetflag) {
         msg =
             String.format(
-                "got an old stage(%d vs %d) shuffle write failure report, 
which should be impossible.",
-                shuffleServerFailureRecord.getStageAttempt(), 
stageAttemptNumber);
+                "got an old stage(%d_%d) shuffle write failure report, which 
should be impossible.",
+                stageAttemptId, stageAttemptNumber);
         LOG.warn(msg);
         code = RssProtos.StatusCode.INVALID_REQUEST;
         reSubmitWholeStage = false;
       } else {
         code = RssProtos.StatusCode.SUCCESS;
         // update the stage shuffleServer write failed count
-        boolean fetchFailureflag =
-            shuffleServerFailureRecord.incPartitionWriteFailure(
+        boolean isFetchFailed =

Review Comment:
   > Is this only valid for shuffle write failure, not including shuffle 
reading failure?
   
   Here just Write process fails, the Read process is controlled by 
reportShuffleFetchFailure.



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