Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
askwang committed Nov 6, 2024
1 parent 29c4c12 commit 007cacf
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 007cacf

Please sign in to comment.