Skip to content

[lake/iceberg] Support snapshot expiration for lake tables#2881

Open
vamossagar12 wants to merge 3 commits intoapache:mainfrom
vamossagar12:fluss-2213
Open

[lake/iceberg] Support snapshot expiration for lake tables#2881
vamossagar12 wants to merge 3 commits intoapache:mainfrom
vamossagar12:fluss-2213

Conversation

@vamossagar12
Copy link
Contributor

Purpose

Linked issue: close #2213

Brief change log

Similar to #2182, this PR adds support for snapshot expiration for Iceberg tables.

Tests

fluss-lake/fluss-lake-iceberg/src/test/java/org/apache/fluss/lake/iceberg/tiering/IcebergTieringTest.java

API and Format

N/A

Documentation

No. The configs table.datalake.auto-expire-snapshot and tiering service config lake.tiering.auto-expire-snapshot already exist. This PR makes Iceberg implement it.

@vamossagar12
Copy link
Contributor Author

@luoyuxia please review this PR. Thanks!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Iceberg support for automatic snapshot expiration in Fluss lake tiering commits, controlled by existing table/tiering configs (mirroring prior Paimon behavior) and validated via new Iceberg tiering tests.

Changes:

  • Trigger Iceberg snapshot expiration after successful tiering commits when either table.datalake.auto-expire-snapshot or lake.tiering.auto-expire-snapshot is enabled.
  • Pass full CommitterInitContext into IcebergLakeCommitter so it can read table/tiering configs.
  • Add a parameterized Iceberg tiering test to verify snapshot retention/expiration behavior under different config combinations.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
fluss-lake/fluss-lake-iceberg/src/main/java/org/apache/fluss/lake/iceberg/tiering/IcebergLakeTieringFactory.java Wires CommitterInitContext into the committer so commit-time behavior can depend on configs.
fluss-lake/fluss-lake-iceberg/src/main/java/org/apache/fluss/lake/iceberg/tiering/IcebergLakeCommitter.java Implements optional snapshot expiration after commits based on table/tiering configuration.
fluss-lake/fluss-lake-iceberg/src/test/java/org/apache/fluss/lake/iceberg/tiering/IcebergTieringTest.java Adds parameterized coverage for snapshot expiration and enables passing tiering config into the committer in tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

[lake/iceberg] Support snapshot expiration for lake tables

2 participants