Skip to content

[Bug] Files of buckets prepared before a failed PrepareCommit() are orphaned, and a retry commits without them #611

Backlog

Description

@SteNicholas

Search before asking

  • I searched in the issues and found nothing similar.

Paimon-cpp version

main (786badf)

Minimal reproduce step

  1. Create an append table with two buckets and write rows to both.
  2. Make PrepareCommit() succeed for the first bucket visited and fail for the second, e.g. with an I/O error while closing its data file.
  3. Retry PrepareCommit() in streaming mode, or close the write.

What doesn't meet your expectations?

AbstractFileStoreWrite::PrepareCommit() drains the increment of each bucket in turn. When a later bucket fails, the commit messages already built for the earlier buckets are dropped with the result:

  • their new data files and compaction outputs are never committed and stay in the table directory, and Close() no longer knows about them;
  • in streaming mode, a retry of PrepareCommit() commits without those increments, since their writers have nothing left to drain, so the rows are lost.

Expected the files of the dropped increments to be deleted, at least for append-only tables, whose files are all newly written, and a retry after such a failure to be rejected rather than silently committing without them.

Anything else?

Code: src/paimon/core/operation/abstract_file_store_write.cpp, AbstractFileStoreWrite::PrepareCommit().

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. added
    bug
    on Dec 2, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions