Skip to content

[Bug] AppendOnlyWriter::Close() skips its cleanup when the compaction sync or the compact manager close fails #609

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 AppendOnlyWriter whose compact manager returns an error from GetCompactionResult() or Close(), e.g. an I/O error while syncing a finished compaction.
  2. Leave uncommitted compaction outputs in the writer, then call Close().

What doesn't meet your expectations?

Close() returns at the first failing step (PAIMON_RETURN_NOT_OK(Sync()), then compact_manager_->Close()), so it skips deleting the compaction outputs in compact_after_, aborting the open data file writer and cleaning the compact deletion file. These files are left behind uncommitted.

Expected every cleanup step to run even if an earlier one fails, returning the first error, as Paimon Java does with IOUtils.closeAll(...) in AppendOnlyWriter#close, and the compaction task to be waited for even when the sync fails.

Anything else?

Code: src/paimon/core/append/append_only_writer.cpp, AppendOnlyWriter::Close().

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