1996fanrui commented on a change in pull request #9602: URL: https://github.com/apache/flink/pull/9602#discussion_r615571707
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CompletedCheckpoint.java ########## @@ -281,6 +285,30 @@ private void doDiscard() throws Exception { } } + private Set<StreamStateHandle> getSharedStateHandle() { + Set<StreamStateHandle> sharedStateHandles = new HashSet<>(operatorStates.size()); + + //reference SavepointV2Serializer.serializeKeyedStateHandle + operatorStates.values().forEach(operatorState -> { + operatorState.getStates().forEach(operatorSubtaskState -> { + if (operatorSubtaskState != null) { + for (KeyedStateHandle managedKeyedState : operatorSubtaskState.getManagedKeyedState()) { + if (managedKeyedState instanceof IncrementalRemoteKeyedStateHandle) { + sharedStateHandles.addAll(((IncrementalRemoteKeyedStateHandle) managedKeyedState).getSharedState().values()); Review comment: Cleaning up all shared state(FileStateHandle) will cause SharedStateRegistry to become invalid, and all shared state will be cleaned up? Please confirm, has the sst file used by subsequent Checkpoint been deleted? -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org