Skip to content

[common] Honor consumer.changelog-only when expiring snapshots through procedures - #11708

Open
thswlsqls wants to merge 1 commit into
apache:masterfrom
thswlsqls:fix/procedure-expire-consumer-changelog-only
Open

thswlsqls wants to merge 1 commit into
apache:masterfrom
thswlsqls:fix/procedure-expire-consumer-changelog-only

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Purpose

fix #11707

  • ProcedureUtils.fillInSnapshotOptions() never sets consumerChangelogOnly, so expire_snapshots procedures and actions always let consumers fence snapshots, unlike CoreOptions#expireConfig().
  • Follow-up parity to [common] Honor changelog retention when expiring snapshots #10928, which aligned the procedure retention options but explicitly left consumer handling unchanged.
  • The flag is conditional: CoreOptions#consumerChangelogOnly() already ANDs changelogLifecycleDecoupled(), and procedure overrides can change that per run, so the check uses the effective config. Passing the option through unconditionally would delete a stalled consumer's snapshot and changelog in a coupled run (e.g. retain_max reaching the changelog max).

Tests

  • Added SnapshotChangelogRetentionVerificationTest#testConsumerChangelogOnly, #testConsumerChangelogOnlyWithRetainMaxOverride, #testConsumerChangelogOnlyWithOlderThanOverride: parity with expireConfig(), coupled overrides, option off.
  • Without the fix, 3 cases fail (expected true, was false). With it, 14/14 pass.
  • mvn spotless:check and mvn -pl paimon-common clean install (JDK 11) pass: 13315 + 144 tests, 0 failures. Flink ExpireSnapshotsProcedureITCase and Spark ExpireSnapshotsProcedureTest not run locally, covered by CI.

…h procedures

fillInSnapshotOptions never set consumerChangelogOnly, so expire_snapshots
procedures and actions always let consumers fence snapshot expiration even
when the table enables consumer.changelog-only. Set it like
CoreOptions#consumerChangelogOnly, but only while the effective expiration
(after procedure overrides) keeps changelogs longer than snapshots.

Generated-by: Claude Code
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.

[Bug] expire_snapshots procedures ignore consumer.changelog-only

1 participant