1996fanrui commented on code in PR #20233:
URL: https://github.com/apache/flink/pull/20233#discussion_r923351868


##########
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/channel/ChannelStateWriterImpl.java:
##########
@@ -60,89 +63,78 @@
 public class ChannelStateWriterImpl implements ChannelStateWriter {
 
     private static final Logger LOG = 
LoggerFactory.getLogger(ChannelStateWriterImpl.class);
-    private static final int DEFAULT_MAX_CHECKPOINTS =
-            1000; // includes max-concurrent-checkpoints + checkpoints to be 
aborted (scheduled via
-    // mailbox)

Review Comment:
   Hi @pnowojski , thanks for your review.
   
   The `checkpointId < nextExpectedCheckpointId` may happen. For example, 
`AlternatingWaitingForFirstBarrierUnaligned#barrierReceived` don't check 
whether checkpointId is aborted, if received a barrier, it will call the 
ChannelStateWriter.start().
   
   - If `checkpointId < ongoingCheckpointId`, it should throw exception.
   - If `checkpointId < nextExpectedCheckpointId` that is `checkpointId >= 
ongoingCheckpointId && abortedCheckpointIds.contains(checkpointId)`,  it should 
ignore the checkpoint.
   - If `checkpointId >= ongoingCheckpointId && 
!abortedCheckpointIds.contains(checkpointId)`, the ongoingCheckpointId should  
be updated, and start this checkpoint.
   
   So, we should use `ongoingCheckpointId`, and just update it within 
`ChannelStateWriterImpl#start`
   
   We should ignore checkpoint when the checkpointId is aborted, so we  need 
the `NavigableSet<Long> abortedCheckpointIds;`.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to