Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-20389][tests] Fix UnalignedCheckpointITCase to work with unassigned splits. #14250

Merged
merged 1 commit into from Nov 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -224,8 +224,8 @@ public List<LongSplit> snapshotState(long checkpointId) {

@Override
public void notifyCheckpointComplete(long checkpointId) {
LOG.info("notifyCheckpointComplete {} @ {} subtask (? attempt)", split.numCompletedCheckpoints, split.nextNumber % split.increment);
if (split != null) {
LOG.info("notifyCheckpointComplete {} @ {} subtask (? attempt)", split.numCompletedCheckpoints, split.nextNumber % split.increment);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can split.increment be 0 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Increment = parallelism, so it would be a bug at a different point. But good question.

split.numCompletedCheckpoints++;
}
}
Expand Down Expand Up @@ -330,6 +330,11 @@ public void addReader(int subtaskId) {
}
}

@Override
public void notifyCheckpointComplete(long checkpointId) {
unassignedSplits.forEach(s -> s.numCompletedCheckpoints++);
}

@Override
public List<LongSplit> snapshotState() throws Exception {
LOG.info("snapshotState {}", unassignedSplits);
Expand Down Expand Up @@ -673,6 +678,5 @@ public void close() throws Exception {
LOG.info("Last state {} @ {} subtask ({} attempt)", state, getRuntimeContext().getIndexOfThisSubtask(), getRuntimeContext().getAttemptNumber());
super.close();
}

}
}