Skip to content

[Feature] Table maintenance: snapshot expiration and orphan file cleanup #964

Description

@zhuxiangyi

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

Java Paimon expires snapshots after every commit and provides expire_snapshots and
remove_orphan_files procedures. paimon-rust has none of these, so a table written through the
Rust API, pypaimon native, or the C FFI keeps every snapshot forever. Each commit adds a snapshot,
manifest lists, and manifests, and files replaced by overwrites or row-level rewrites are never
removed. Files left behind by failed or interrupted writes are never cleaned up either.

Solution

Port Java's table maintenance in small, independently reviewable PRs, each following the Java
implementation and keeping its safety rules. (Every read failure deletes less, never more. A file
still referenced by any snapshot, tag, branch, or consumer is never deleted.)

Later, not in these PRs:

  • a changelog manager and decoupled changelog expiration (changelog.num-retained.*,
    changelog.time-retained);
  • snapshot.clean-empty-directories and empty-directory cleanup;
  • partition expiration.

Anything else?

The PRs are stacked: #966, #967 and #968 each build on #965 and are independent of each other.

Willingness to contribute

  • I'm willing to submit a PR!

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions