rkhachatryan commented on code in PR #20313:
URL: https://github.com/apache/flink/pull/20313#discussion_r934552771


##########
flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistryImpl.java:
##########
@@ -365,4 +401,19 @@ public String toString() {
             return "EmptyDiscardStateObject{" + stateHandleID + '}';
         }
     }
+
+    private boolean preventsDiscardingCreatedCheckpoint(SharedStateEntry 
entry) {
+        // explicitly set by the backend, e.g. private state is reused
+        if (entry.preventDiscardingCreatedCheckpoint
+                && 
restoredCheckpointSharingStrategies.containsKey(entry.createdByCheckpointID)) {
+            return true;
+        }
+        // with NO_SHARING strategy, shared state, if any, is bundled inside 
the checkpoint folder
+        // noinspection RedundantIfStatement
+        if (NO_SHARING == 
restoredCheckpointSharingStrategies.get(entry.createdByCheckpointID)) {

Review Comment:
   > You mean that SharingFilesStrategy only applys on runtime but not on 
recovery ?
   
   Yes.
   
   > why we need to clarify NO_SHARING here, Do other strategies also need to 
contain these logics ?
   
   Testing for `NO_SHARING` here allows to delay discarding the checkpoint 
folder. Delay is necdesary if the checkpoint that was created with `NO_SHARING` 
because it implies "bundling" all files into the folder, including those 
potentially re-used after recovery.
   Other strategies don't imply that.



-- 
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