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



##########
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:
       No expire happens:
   write the hint file in order to see the earliest snapshot directly next time
   should avoid duplicate writes when the file exists




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