From 287929c407d26541f1af1c7eaed24507d691725d Mon Sep 17 00:00:00 2001 From: Jinzhong Li Date: Fri, 16 Dec 2022 11:38:14 +0800 Subject: [PATCH] [FLINK-28863][state]Add comments about why snapshot result of RocksDB native savepoint doesn't have empty shared-state --- .../state/snapshot/RocksIncrementalSnapshotStrategy.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/snapshot/RocksIncrementalSnapshotStrategy.java b/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/snapshot/RocksIncrementalSnapshotStrategy.java index bd464b056778f..67c6a9659e4a0 100644 --- a/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/snapshot/RocksIncrementalSnapshotStrategy.java +++ b/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/snapshot/RocksIncrementalSnapshotStrategy.java @@ -294,6 +294,15 @@ public SnapshotResult get(CloseableRegistry snapshotCloseableR checkpointedSize += getUploadedStateSize(sstFiles.values()); checkpointedSize += getUploadedStateSize(miscFiles.values()); + // We make the 'sstFiles' as the 'sharedState' in IncrementalRemoteKeyedStateHandle, + // whether they belong to the sharded CheckpointedStateScope or exclusive + // CheckpointedStateScope. + // In this way, the first checkpoint after job recovery can be an incremental + // checkpoint in CLAIM mode, either restoring from checkpoint or restoring from + // native savepoint. + // And this has no effect on the registration of shareState currently, because the + // snapshot result of native savepoint would not be registered into + // 'SharedStateRegistry'. final IncrementalRemoteKeyedStateHandle jmIncrementalKeyedStateHandle = new IncrementalRemoteKeyedStateHandle( backendUID,