diff --git a/paimon-core/src/main/java/org/apache/paimon/table/AbstractFileStoreTable.java b/paimon-core/src/main/java/org/apache/paimon/table/AbstractFileStoreTable.java index 42097313acdb..a74ef847accf 100644 --- a/paimon-core/src/main/java/org/apache/paimon/table/AbstractFileStoreTable.java +++ b/paimon-core/src/main/java/org/apache/paimon/table/AbstractFileStoreTable.java @@ -512,13 +512,12 @@ public void rollbackTo(long snapshotId) { "Rollback snapshot '%s' doesn't exist.", snapshotId); - Snapshot snapshot = snapshotManager.snapshot(snapshotId); // fast return - if (snapshot.equals(snapshotManager.latestSnapshot())) { + if (new Long(snapshotId).equals(snapshotManager.latestSnapshotId())) { return; } - rollbackHelper().cleanLargerThan(snapshot); + rollbackHelper().cleanLargerThan(snapshotManager.snapshot(snapshotId)); } public Snapshot findSnapshot(long fromSnapshotId) throws SnapshotNotExistException { @@ -633,7 +632,7 @@ public void rollbackTo(String tagName) { Snapshot taggedSnapshot = tagManager.taggedSnapshot(tagName); SnapshotManager snapshotManager = snapshotManager(); // fast return - if (taggedSnapshot.equals(snapshotManager.latestSnapshot())) { + if (new Long(taggedSnapshot.id()).equals(snapshotManager.latestSnapshotId())) { return; }