Skip to content

[Bug] Append-only writer loses rows or commits aborted files after a data file write or close fails #612

Backlog

Description

@SteNicholas

Search before asking

  • I searched in the issues and found nothing similar.

Paimon-cpp version

main (786badf)

Minimal reproduce step

  1. Write rows to an append-only bucket without a write buffer, e.g. with target-file-row-num = 1 so that a later write opens a new data file.
  2. Make a later Write(), or the data file close in PrepareCommit(), fail with an I/O error.
  3. Retry: write again and call PrepareCommit().

What doesn't meet your expectations?

RollingFileWriter::Write() and Close() abort every data file of the writer on failure, including files it already rolled and closed, so the rows written since the last flush are gone. AppendOnlyWriter reports only the failed call and accepts later writes and commits:

  • after a failed Write(), later writes go to the aborted rolling writer;
  • after a failed close, the next PrepareCommit() sees a closed writer and returns its results, i.e. data files that were already deleted, or drops the rows if the writer was discarded.

Either way the commit no longer contains each accepted row exactly once. Expected the writer to remember the failure and return it from every later Write() and PrepareCommit(), so the caller closes it and writes the rows since the last commit again.

Anything else?

Code: src/paimon/core/append/append_only_writer.cpp, AppendOnlyWriter::Write() and AppendOnlyWriter::Flush().

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