lindong28 commented on code in PR #20454: URL: https://github.com/apache/flink/pull/20454#discussion_r941407449
########## flink-runtime/src/main/java/org/apache/flink/runtime/operators/coordination/OperatorCoordinatorHolder.java: ########## @@ -299,9 +352,67 @@ public void resetToCheckpoint(long checkpointId, @Nullable byte[] checkpointData } private void checkpointCoordinatorInternal( - final long checkpointId, final CompletableFuture<byte[]> result) { + long checkpointId, CompletableFuture<byte[]> result) { mainThreadExecutor.assertRunningInMainThread(); + try { + subtaskGatewayMap.forEach( + (subtask, gateway) -> gateway.markForCheckpoint(checkpointId)); + + if (currentPendingCheckpointId != NO_CHECKPOINT Review Comment: It seems simpler to just do the following outside the try/catch loop ``` if (!(latestAttemptedCheckpointId < checkpointId && currentPendingCheckpointId == NO_CHECKPOINT)) { throw new IllegalStateException(...) } ``` -- 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