Myasuka commented on a change in pull request #18086:
URL: https://github.com/apache/flink/pull/18086#discussion_r768445293



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/state/StateBackend.java
##########
@@ -172,4 +174,19 @@ OperatorStateBackend createOperatorStateBackend(
     default boolean useManagedMemory() {
         return false;
     }
+
+    /**
+     * Tells if a state backend supports taking forced full snapshots. Forced 
full snapshots are
+     * snapshots that do not share files with previous snapshots. The feature 
is necessary to
+     * properly support {@link RestoreMode#NO_CLAIM} mode.
+     *
+     * <p>If a state backend supports forced full snapshots, it should create 
an independent
+     * snapshot when it receives {@link 
CheckpointOptions#isForcedFullSnapshot()} request in {@link
+     * Snapshotable#snapshot(long, long, CheckpointStreamFactory, 
CheckpointOptions)}.
+     *
+     * @return If the state backend supports taking forced full snapshots.
+     */
+    default boolean supportsForcedFullSnapshot() {

Review comment:
       I think it's okay to tell Flink whether this state backend supports to 
run force full snapshot.
   However, shall we distinguish keyed state backend and operator state backend 
here?

##########
File path: 
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/snapshot/RocksIncrementalSnapshotStrategy.java
##########
@@ -179,6 +179,7 @@ public IncrementalRocksDBSnapshotResources 
syncPrepareResources(long checkpointI
 
         return new RocksDBIncrementalSnapshotOperation(
                 checkpointId,
+                !checkpointOptions.isForcedFullSnapshot(),

Review comment:
       I think we should add the flag of `forceFullSnapshot` in 
`SnapshotStrategy#asyncSnapshot` to let user could leverage this information.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to