Sitelet https://github.com/apache/paimon/pull/10355
Skip to content

[core] Reject a non-positive snapshot.expire.limit - #10355

Open
jackylee-ch wants to merge 1 commit into
apache:masterfrom
jackylee-ch:core-reject-non-positive-expiration-options
Open

jackylee-ch wants to merge 1 commit into
apache:masterfrom
jackylee-ch:core-reject-non-positive-expiration-options

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

Purpose

snapshot.expire.limit is "the maximum number of snapshots allowed to expire at a time" (default 50). ExpireSnapshotsImpl validates snapshot.num-retained.min/max, but not this option. A non-positive value (0 is a natural "no limit" guess) makes maxExclusive = min(maxExclusive, earliest + maxDeletes) collapse to earliest, so the expiration loop never runs: snapshots and their data files are never reclaimed and disk grows unbounded, with no error or log.

This rejects a non-positive snapshot.expire.limit with a clear message, consistent with the adjacent retainMin / retainMax checks.

Tests

ExpireSnapshotsTest#testExpireRejectsNonPositiveLimit: asserts expire() throws IllegalArgumentException for limit 0 and -1, and that no snapshot is deleted — mirroring testExpireRejectsNonPositiveRetainMin.

API and Format

No change.

Documentation

No change.

snapshot.expire.limit is the maximum number of snapshots allowed to expire at
a time. ExpireSnapshotsImpl validates retainMin and retainMax but not this
option, so a non-positive value (0 is a natural "no limit" guess) caps
maxExclusive at the earliest snapshot and silently expires nothing: snapshots
and their data files are never reclaimed and disk grows unbounded, with no
error.

Validate it alongside the existing retainMin/retainMax checks, and cover the 0
and -1 cases with a test mirroring the retainMin rejection test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant