fredia commented on code in PR #20313: URL: https://github.com/apache/flink/pull/20313#discussion_r934714748
########## flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistryImpl.java: ########## @@ -342,6 +342,10 @@ private void advanceLastUsingCheckpointID(long checkpointID) { } private void preventDiscardingCreatedCheckpoint() { + // Changed from false to true when a newer checkpoint starts reusing this state entry + // after recovery. This is to delay discarding the initial checkpoint until all of its Review Comment: nit: This is to delay discarding the ~initial~ checkpoint until all of its state (both shared and private) is not used. The **initial** checkpoint is handled by [`restoredCheckpointSharingStrategies`](https://github.com/apache/flink/pull/20313/commits/34fa6de59b115f960e738b146db4b659287f4a8c#diff-87db13d9f5e3cf08a68052f9eba6c97ab22572fb5b5ccb0cabff7104efb21cebR412). ########## flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistryImpl.java: ########## @@ -192,6 +211,13 @@ public void registerAll( @Override public void registerAllAfterRestored(CompletedCheckpoint checkpoint, RestoreMode mode) { registerAll(checkpoint.getOperatorStates().values(), checkpoint.getCheckpointID()); + checkpoint + .getRestoredProperties() Review Comment: When off->on, if the "off" checkpoint is V3, the following branch will not be executed: ```Java if (entry.preventDiscardingCreatedCheckpoint && restoredCheckpointSharingStrategies.containsKey(entry.createdByCheckpointID)) { return true; } ``` -- 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