diff --git a/paimon-core/src/main/java/org/apache/paimon/table/ExpireSnapshotsImpl.java b/paimon-core/src/main/java/org/apache/paimon/table/ExpireSnapshotsImpl.java index ba95bde5fc09..ab89cad26bf1 100644 --- a/paimon-core/src/main/java/org/apache/paimon/table/ExpireSnapshotsImpl.java +++ b/paimon-core/src/main/java/org/apache/paimon/table/ExpireSnapshotsImpl.java @@ -120,7 +120,7 @@ public int expire() { // Ensure maxExclusive exist, deal some snapshot between earliest and latest is deleted maxExclusiveByExpireLimit++; } - maxExclusive = Math.min(maxExclusive, maxExclusiveByExpireLimit); + maxExclusive = Math.min(maxExclusive, earliest + maxDeletes); for (long id = min; id < maxExclusive; id++) { // Early exit the loop for 'snapshot.time-retained'