flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] pnowojski commented on a change in pull request #16913: [FLINK-23809][checkpoint] Respect the finished flag when extracting operator states due to skip in-flight data
Date Mon, 23 Aug 2021 11:06:39 GMT

pnowojski commented on a change in pull request #16913:
URL: https://github.com/apache/flink/pull/16913#discussion_r693874717



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java
##########
@@ -1601,10 +1601,15 @@ private OptionalLong restoreLatestCheckpointedStateInternal(
         // Create the new operator states without in-flight data.
         for (OperatorState originalOperatorState : originalOperatorStates.values()) {
             OperatorState newState =
-                    new OperatorState(
-                            originalOperatorState.getOperatorID(),
-                            originalOperatorState.getParallelism(),
-                            originalOperatorState.getMaxParallelism());
+                    originalOperatorState.isFullyFinished()
+                            ? new FullyFinishedOperatorState(
+                                    originalOperatorState.getOperatorID(),
+                                    originalOperatorState.getParallelism(),
+                                    originalOperatorState.getMaxParallelism())
+                            : new OperatorState(
+                                    originalOperatorState.getOperatorID(),
+                                    originalOperatorState.getParallelism(),
+                                    originalOperatorState.getMaxParallelism());

Review comment:
       I would extract this logic (and some lines below) to a method like `OperatorState OperatorState#discardInFlightData()`
method, that would return the `newState`. It would be less error prone  to have this logic
encapsulated in the `OperatorState` class.




-- 
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-unsubscribe@flink.apache.org

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



Mime
View raw message