zhuzhurk commented on code in PR #25551:
URL: https://github.com/apache/flink/pull/25551#discussion_r1896509112
##########
flink-runtime/src/main/java/org/apache/flink/runtime/deployment/ConsumedSubpartitionContext.java:
##########
@@ -46,6 +49,20 @@ class ConsumedSubpartitionContext implements Serializable {
/**
* A mapping between ranges of consumed shuffle descriptors and their
corresponding subpartition
* ranges.
+ *
+ * <p>For ALL_TO_ALL the consumed partition range to subpartition range
might like this:task1
Review Comment:
-> might be like
##########
flink-runtime/src/main/java/org/apache/flink/runtime/deployment/ConsumedSubpartitionContext.java:
##########
@@ -46,6 +49,20 @@ class ConsumedSubpartitionContext implements Serializable {
/**
* A mapping between ranges of consumed shuffle descriptors and their
corresponding subpartition
* ranges.
+ *
+ * <p>For ALL_TO_ALL the consumed partition range to subpartition range
might like this:task1
+ * :[0, 10] -> [0, 0]; task2 :[0,5] -> [1,1]; task3: [6,10] -> [1,1],
[0,10] -> [2,2], [0,5] ->
+ * [3,3] task4: [6,10] -> [3,3]. Since ALL_TO_ALL shares the same set of
shuffle descriptors,
+ * the index mapping from partition rang to shuffle descriptor is:
[0,10]->[0,10]. Finally, the
Review Comment:
-> partition range to shuffle descriptor range
##########
flink-runtime/src/main/java/org/apache/flink/runtime/deployment/ConsumedSubpartitionContext.java:
##########
@@ -46,6 +49,20 @@ class ConsumedSubpartitionContext implements Serializable {
/**
* A mapping between ranges of consumed shuffle descriptors and their
corresponding subpartition
* ranges.
+ *
+ * <p>For ALL_TO_ALL the consumed partition range to subpartition range
might like this:task1
+ * :[0, 10] -> [0, 0]; task2 :[0,5] -> [1,1]; task3: [6,10] -> [1,1],
[0,10] -> [2,2], [0,5] ->
+ * [3,3] task4: [6,10] -> [3,3]. Since ALL_TO_ALL shares the same set of
shuffle descriptors,
Review Comment:
Looks to me the situation of subpartition 3 is very similar to that of
subpartition 1? maybe exclude subpartition 3 and task4 to make this case
simpler?
##########
flink-runtime/src/main/java/org/apache/flink/runtime/deployment/ConsumedSubpartitionContext.java:
##########
@@ -118,11 +141,23 @@ public static ConsumedSubpartitionContext
buildConsumedSubpartitionContext(
partitions[partitionRange.getStartIndex()]),
partitionIdToShuffleDescriptorIndexMap.get(
partitions[partitionRange.getEndIndex()]));
- checkState(partitionRange.size() == shuffleDescriptorRange.size());
- numConsumedShuffleDescriptors += shuffleDescriptorRange.size();
+ checkState(
+ partitionRange.size() == shuffleDescriptorRange.size()
+ &&
!consumedShuffleDescriptorToSubpartitionRangeMap.containsKey(
+ shuffleDescriptorRange));
consumedShuffleDescriptorToSubpartitionRangeMap.put(
shuffleDescriptorRange, subpartitionRange);
}
+ // For ALL_TO_ALL, there might be overlaps in shuffle descriptor to
subpartition range map:
+ // [0,10] -> [2,2], [0,5] -> [3,3], so we need to count consumed
shuffle descriptors after
+ // merging.
+ int numConsumedShuffleDescriptors = 0;
+ List<IndexRange> mergedConsumedShuffleDescriptor =
+ IndexRangeUtil.mergeIndexRanges(
+
consumedShuffleDescriptorToSubpartitionRangeMap.keySet());
Review Comment:
Will this result list contain only one range?
--
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]