Skip to content

Support retainLast and setMinSnapshotsToKeep Snapshot Retention Policies #2150

Open
@ForeverAngry

Description

@ForeverAngry

Feature Request / Improvement

Overview

The Apache Iceberg Java API provides more robust and flexible retention options for expiring Snapshots, including:

  • retainLast(n) – Retain the most recent n snapshots.
  • setMinSnapshotsToKeep(n) – Ensure a minimum number of snapshots are always retained.

Description

Adding support for non-time-based retention strategies provides better control over snapshot pruning. This ensures operational resilience while still allowing space reclamation. For example:

  • retainLast(n) is helpful when regular snapshot creation occurs and users always want to keep the last few for rollback.
  • setMinSnapshotsToKeep(n) acts as a guardrail to prevent aggressive expiration logic from removing too many snapshots.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions