Github user StephanEwen commented on a diff in the pull request:
https://github.com/apache/flink/pull/2964#discussion_r91547796
--- Diff:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/BarrierTracker.java
---
@@ -225,17 +230,19 @@ private void
processCheckpointAbortBarrier(CancelCheckpointMarker barrier, int c
pendingCheckpoints.removeFirst();
}
}
- else {
+ else if (checkpointId > latestPendingCheckpointID) {
notifyAbort(checkpointId);
- // first barrier for this checkpoint - remember it as
aborted
- // since we polled away all entries with lower
checkpoint IDs
- // this entry will become the new first entry
- if (pendingCheckpoints.size() <
MAX_CHECKPOINTS_TO_TRACK) {
- CheckpointBarrierCount abortedMarker = new
CheckpointBarrierCount(checkpointId);
- abortedMarker.markAborted();
- pendingCheckpoints.addFirst(abortedMarker);
- }
+ latestPendingCheckpointID = checkpointId;
+
+ CheckpointBarrierCount abortedMarker = new
CheckpointBarrierCount(checkpointId);
+ abortedMarker.markAborted();
+ pendingCheckpoints.addLast(abortedMarker);
--- End diff --
Small comment here: I would
- either keep the `addFirst()` statement here (we can be sure that is
true, given that we pulled out all older checkpoints)
- or add a sanity check that `pendingCheckpoints` is empty at that point.
That way we explicitly guard the assumption that `pendingCheckpoints`
contains entries on ordered sequence (which is currently only implicitly
guarded by the `checkpointId > latestPendingCheckpointID` condition.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---