Skip to content

Commit

Permalink
[flink] Bugfix expire snapshot don't work when some snapshot between …
Browse files Browse the repository at this point in the history
…earliest and latest are removed for some reason
  • Loading branch information
jiangqiao.xu committed Dec 20, 2024
1 parent 8ade15f commit bc417db
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ public int expire() {

// protected by 'snapshot.expire.limit'
// (the maximum number of snapshots allowed to expire at a time)
long maxExclusiveByExpireLimit = earliest + maxDeletes;
while (!snapshotManager.snapshotExists(maxExclusiveByExpireLimit)) {
// Ensure maxExclusive exist, deal some snapshot between earliest and latest is deleted
maxExclusiveByExpireLimit++;
}
maxExclusive = Math.min(maxExclusive, earliest + maxDeletes);

for (long id = min; id < maxExclusive; id++) {
Expand Down

0 comments on commit bc417db

Please sign in to comment.