[FLINK-40269][runtime] Fix channel state assignment for duplicate connections - #28856
Merged
1996fanrui merged 2 commits intoAug 1, 2026
Merged
Conversation
1996fanrui
marked this pull request as ready for review
July 31, 2026 12:55
Collaborator
rkhachatryan
approved these changes
Jul 31, 2026
rkhachatryan
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the fix!
LGTM, I have one minor suggestion to reduce complexity, PTAL.
Comment on lines
+269
to
+275
| (gateIndex, assignment, recompute) -> { | ||
| int assignmentIndex = | ||
| getAssignmentIndex( | ||
| assignment.getDownstreamAssignments(), this); | ||
| assignment.findResultPartitionIndex( | ||
| executionJobVertex | ||
| .getInputs() | ||
| .get(gateIndex) | ||
| .getId()); |
Contributor
There was a problem hiding this comment.
Can we simplify this with something like
private SubtasksRescaleMapping getOutputMapping(
IntermediateDataSetID resultId, boolean recompute) {
return getOutputMapping(findResultPartitionIndex(resultId), recompute);
}
private SubtasksRescaleMapping getInputMapping(
IntermediateDataSetID resultId, boolean recompute) {
return getInputMapping(findInputGateIndex(resultId), recompute);
}
// getSubtaskState (input side)
(gateIndex, assignment, recompute) ->
assignment.getOutputMapping(
executionJobVertex.getInputs().get(gateIndex).getId(), recompute)
// computeOutputRescalingDescriptor (output side)
(partitionIndex, downstreamAssignment, recompute) ->
downstreamAssignment.getInputMapping(
executionJobVertex.getProducedDataSets()[partitionIndex].getId(), recompute)
?
Contributor
Member
Author
There was a problem hiding this comment.
Hey @rkhachatryan , thanks for the quick review!
I have merged 26be3b1 into the second commit, and only fixed some checkstyle issues.
FYI: and marked you as the co-author.
Contributor
There was a problem hiding this comment.
Thanks!
(I'm not the co-author of the fix though)
…nections Co-authored-by: Roman Khachatryan <khachatryan.roman@gmail.com>
1996fanrui
force-pushed
the
FLINK-40269-unaligned-same-upstream-rescale
branch
from
July 31, 2026 20:36
039cb7a to
8652d59
Compare
rkhachatryan
approved these changes
Jul 31, 2026
wenshao
approved these changes
Aug 1, 2026
wenshao
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
— qwen3.8-max-preview via Qwen Code /review (v0.21.2)
wenshao
approved these changes
Aug 1, 2026
wenshao
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
— qwen3.8-max-preview via Qwen Code /review (v0.21.2)
This was referenced Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
This pull request fixes channel state assignment for unaligned checkpoint recovery when a downstream job vertex has multiple input gates connected to the same upstream job vertex.
Previously,
TaskStateAssignmentlooked up connected assignments by the upstream/downstreamTaskStateAssignmentinstance. If multiple edges connect the same pair of job vertices, this can select the first matching edge and use the wrong input gate or result partition mapping.Brief change log
IntermediateDataSetIDto resolve the corresponding input gate and result partition during channel state assignment.Verifying this change
This change added tests and can be verified as follows:
./mvnw -pl flink-runtime -Dtest=StateAssignmentOperationTest -Djdk11 -Pjava11-target test./mvnw -pl flink-tests -Dtest=UnalignedCheckpointRescaleSameUpstreamITCase -Dsurefire.failIfNoSpecifiedTests=false -Djdk11 -Pjava11-target -DtrimStackTrace=false surefire:test@integration-testsDoes this pull request potentially affect one of the following parts:
Documentation