RexXiong commented on code in PR #3320:
URL: https://github.com/apache/celeborn/pull/3320#discussion_r2139434738
##########
client-spark/spark-3/src/main/scala/org/apache/spark/shuffle/celeborn/CelebornShuffleReader.scala:
##########
@@ -240,7 +240,17 @@ 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)
+ var locations =
+ if (encodedAttemptId % 2 == 1 && hasReplicate) {
Review Comment:
Not all replicas of the partition location are available, Therefore
hasReplicate is true not mean the partition location has peer.
--
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]