AHeise commented on code in PR #25292:
URL: https://github.com/apache/flink/pull/25292#discussion_r1759078561
##########
flink-runtime/src/main/java/org/apache/flink/streaming/runtime/operators/sink/CommitterOperator.java:
##########
@@ -156,23 +156,16 @@ public void endInput() throws Exception {
@Override
public void notifyCheckpointComplete(long checkpointId) throws Exception {
super.notifyCheckpointComplete(checkpointId);
- if (endInput) {
- // This is the final checkpoint, all committables should be
committed
- lastCompletedCheckpointId = Long.MAX_VALUE;
- } else {
- lastCompletedCheckpointId = Math.max(lastCompletedCheckpointId,
checkpointId);
- }
+ lastCompletedCheckpointId = Math.max(lastCompletedCheckpointId,
checkpointId);
commitAndEmitCheckpoints();
}
private void commitAndEmitCheckpoints() throws IOException,
InterruptedException {
+ long completedCheckpointId = endInput ? EOI :
lastCompletedCheckpointId;
do {
for (CheckpointCommittableManager<CommT> manager :
-
committableCollector.getCheckpointCommittablesUpTo(lastCompletedCheckpointId)) {
- // wait for all committables of the current manager before
submission
- boolean fullyReceived =
- !endInput && manager.getCheckpointId() ==
lastCompletedCheckpointId;
- commitAndEmit(manager, fullyReceived);
+
committableCollector.getCheckpointCommittablesUpTo(completedCheckpointId)) {
Review Comment:
As discussed offline, fullyReceived should always be true because we always
want to have complete batches. For earlier checkpoints, partially committed
batches are still considered fullyReceived as long as all committables arrived
at some point (`fullyReceived === (#pending + #completed + #failed ==
#expected)`)
--
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]