heye1005 commented on code in PR #7715:
URL: https://github.com/apache/paimon/pull/7715#discussion_r4182525772


##########
paimon-core/src/main/java/org/apache/paimon/operation/OrphanFilesClean.java:
##########
@@ -243,22 +243,26 @@ protected boolean isManagedBlobPack(Path path) {
         return 
path.getName().endsWith(ManagedBlobReferenceFile.MANAGED_BLOB_SUFFIX);
     }
 
-    protected Set<Snapshot> safelyGetAllSnapshots(String branch) throws 
IOException {
+    protected Set<Snapshot> safelyGetLiveSnapshots(String branch) throws 
IOException {
         FileStoreTable branchTable = table.switchToBranch(branch);
-        SnapshotManager snapshotManager = branchTable.snapshotManager();
-        ChangelogManager changelogManager = branchTable.changelogManager();
-        TagManager tagManager = branchTable.tagManager();
-        Set<Snapshot> readSnapshots = new 
HashSet<>(snapshotManager.safelyGetAllSnapshots());
-        readSnapshots.addAll(tagManager.taggedSnapshots());
-        readSnapshots.addAll(changelogManager.safelyGetAllChangelogs());
-        return readSnapshots;
+        return new 
HashSet<>(branchTable.snapshotManager().safelyGetAllSnapshots());

Review Comment:
   @JingsongLi Thanks for catching this. Fixed by recording the latest snapshot 
id before and after enumeration and aborting if it changes. This may be 
conservative for frequently committed tables, and I prefer to optimize this by 
checking that the enumerated snapshots include the latest snapshot id observed 
before enumeration.



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