Copilot commented on code in PR #3670:
URL: https://github.com/apache/celeborn/pull/3670#discussion_r3270907853


##########
client/src/main/java/org/apache/celeborn/client/ShuffleClientImpl.java:
##########
@@ -1404,6 +1398,23 @@ public int mergeData(
         false);
   }
 
+  @Override
+  public void computeBatchCRC(
+      int shuffleId,
+      int mapId,
+      int attemptId,
+      int partitionId,
+      byte[] data,
+      int offset,
+      int length) {
+    if (!shuffleIntegrityCheckEnabled) {
+      return;
+    }
+    final String mapKey = Utils.makeMapKey(shuffleId, mapId, attemptId);

Review Comment:
   `computeBatchCRC()` updates `PushState` unconditionally when integrity check 
is enabled, but `pushOrMergeData()` may later ignore the corresponding batch 
(returns early) when `mapperEnded(shuffleId, mapId)` / stage-end is detected. 
In that case CRC/bytes would be accumulated for data that is never 
pushed/merged, and `mapperEnd()` would report incorrect per-partition 
CRC/bytes. Consider adding the same `mapperEnded(shuffleId, 
mapId)`/`isStageEnded(shuffleId)` guard here (and avoid creating a new 
`PushState` via `computeIfAbsent` when already ended) so commit metadata only 
reflects data that will actually be sent.
   



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

Reply via email to