Skip to content

[Bug] Append compaction outputs compacted again before PrepareCommit() are both added and deleted in the commit #608

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 a fixed-bucket append table with compaction enabled, e.g. compaction.min.file-num = 2.
  2. Write enough data files to one bucket that, before the next PrepareCommit(), a compaction output is compacted again, e.g. [a, b] -> i, then [i, c] -> o.
  3. Call PrepareCommit().

What doesn't meet your expectations?

AppendOnlyWriter::TrySyncLatestCompaction() appends every compaction result to compact_before_ and compact_after_, so the increment holds before = [a, b, i, c] and after = [i, o]: the intermediate file i is both added and deleted by the same commit, although it was never handed to a committer.

Expected before = [a, b, c] and after = [o], with i deleted directly. Paimon Java does this in AppendOnlyWriter#updateCompactResult: an input found in compactAfter is removed from it and its files are deleted.

Anything else?

Code: src/paimon/core/append/append_only_writer.cpp, AppendOnlyWriter::TrySyncLatestCompaction(). Only append compaction rewrites files, so this applies to append-only writers.

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