RexXiong commented on code in PR #3490:
URL: https://github.com/apache/celeborn/pull/3490#discussion_r2447557471
##########
client-spark/spark-3/src/main/scala/org/apache/spark/shuffle/celeborn/CelebornShuffleReader.scala:
##########
@@ -241,7 +241,19 @@ class CelebornShuffleReader[K, C](
partitionIdList.foreach { partitionId =>
if (fileGroups.partitionGroups.containsKey(partitionId)) {
- var locations = fileGroups.partitionGroups.get(partitionId)
+ // CELEBORN-2032. For the first time of open stream and
+ // attemptNumber % 2 = 1, we should read the replica data first.
+ val originLocations = fileGroups.partitionGroups.get(partitionId)
+ val hasReplicate = originLocations.asScala.exists(p => p != null &&
p.hasPeer)
Review Comment:
Can we also check whether `celeborn.client.push.replicate.enabled` is
enabled at the same time? If replication is not enabled, we don't need to check
whether the location has a peer. This can help accelerate and simplify the
logic.
--
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]