Skip to content

Add API to drop a specific snapshot by ID #9

Description

@manuzhang

ExpireSnapshots (src/iceberg/update/expire_snapshots.h) supports retention-driven expiration (oldest-than, max-count). It does not expose "drop exactly snapshot X" as a first-class op.

Use cases:

  • Compaction / streaming ingestion that wants to invalidate a specific bad snapshot
  • Recovery: after a failed write that produced a snapshot, drop it without waiting for retention
  • Mirror pipelines (Flink CDC, lakehouse mirror jobs) that produce one snapshot per cycle and need surgical removal

API sketch

Result<std::shared_ptr<DropSnapshot>> Table::NewDropSnapshot();
DropSnapshot& DropSnapshot::SnapshotId(int64_t id);
// Refuses if id is referenced by a branch tip or tag; --force flag to override.

Could be implemented as a thin wrapper over ExpireSnapshots with expireSnapshotId(id).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions