rkhachatryan commented on a change in pull request #17774:
URL: https://github.com/apache/flink/pull/17774#discussion_r767864174



##########
File path: 
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/snapshot/RocksIncrementalSnapshotStrategy.java
##########
@@ -453,6 +470,19 @@ private void uploadSstFiles(
                 miscFiles.putAll(
                         stateUploader.uploadFilesToCheckpointFs(
                                 miscFilePaths, checkpointStreamFactory, 
snapshotCloseableRegistry));
+
+                synchronized (materializedSstFiles) {
+                    // ignore an older upload if it completed after a newer 
one has completed
+                    if (checkpointId > lastCheckpointIdUploadedSst) {
+                        lastCheckpointIdUploadedSst = checkpointId;
+                        lastUploadedSstFiles.clear();
+                        LOG.trace(
+                                "Update lastUploadedSstFiles for checkpoint 
{}: {}",
+                                checkpointId,
+                                sstFiles);
+                        lastUploadedSstFiles.putAll(sstFiles);
+                    }
+                }

Review comment:
       Good point!




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