JingsongLi commented on a change in pull request #56:
URL: https://github.com/apache/flink-table-store/pull/56#discussion_r834086432



##########
File path: 
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/operation/FileStoreExpireImpl.java
##########
@@ -101,18 +120,28 @@ public void expire() {
         }
 
         // no snapshot can be retained, expire all but last one
-        expireUntil(latestSnapshotId);
+        expireUntil(earliest, latestSnapshotId);
     }
 
-    private void expireUntil(long endExclusiveId) {
-        if (endExclusiveId <= Snapshot.FIRST_SNAPSHOT_ID) {
+    private void expireUntil(long earliestId, long endExclusiveId) {
+        if (endExclusiveId <= earliestId) {
+            // write hint file if not exists
+            Path hint = new Path(pathFactory.snapshotDirectory(), 
SnapshotFinder.EARLIEST);
+            try {
+                if (!hint.getFileSystem().exists(hint)) {

Review comment:
       I think the logic is not complicated, which avoids N earliest snapshots 
written before the appearance of expiration.




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