Skip to content

[Bug] FileStore tag manager ignores the table branch, so branch tags are not protected from snapshot expiration #9867

Description

@thswlsqls

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version
master @ bbae07d / 2.2-SNAPSHOT

Compute Engine
Engine-agnostic (core); surfaces via Flink/Spark rollback procedures

Minimal reproduce step

  1. Create a primary-key table, commit once on main.
  2. table.createBranch("branch1"), branchTable = table.switchToBranch("branch1"), commit once.
  3. branchTable.createTag("branch_tag", 1), then commit twice more.
  4. Expire with snapshot.num-retained.min/max = 1 via branchTable.newCommit("").expireSnapshots().
  5. Read branchTable.copy(scan.tag-name = branch_tag): fails with FileNotFoundException: manifest-list-....

Cause: AbstractFileStore.newTagManager() (line 369) passes DEFAULT_MAIN_BRANCH to TagManager, while snapshotManager() (line 190) and AbstractFileStoreTable.tagManager() (line 817) use the table branch. newExpireSnapshots() (line 485) hands that main-branch manager to ExpireSnapshotsImpl.collectTaggedSnapshots() (line 454), which never sees branch tags.

What doesn't meet your expectations?
Branch tags should protect their snapshots, as on main. Instead the tagged snapshot's manifest list and data files are deleted.

Anything else?
Same root cause: automatic tags and _SUCCESS files of branch tables land in the main tag/ directory, and Flink RollbackToProcedure (line 72), RollbackToAsLatestProcedure (line 87) and Spark RollbackProcedure (line 116) cannot find branch tags. #9044 fixed the same pattern in StaticFromTagStartingScanner.

Are you willing to submit a PR?

  • 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