Skip to content

[Bug] Writer memory is not refreshed after FileStoreWrite::Compact() or a failed PrepareCommit() #613

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 table whose writers buffer rows and report their memory, e.g. a primary-key table, with a small write-buffer-size shared by two buckets.
  2. Write rows to bucket A until it uses most of the limit, then call FileStoreWrite::Compact() on bucket A.
  3. Write rows to bucket B.

What doesn't meet your expectations?

MergeTreeWriter::Compact() flushes its write buffer, but AbstractFileStoreWrite::Compact() does not call writer_memory_manager_->RefreshWriterMemory() afterwards, unlike PrepareCommit(). The memory manager keeps the old usage of bucket A, so writing to bucket B triggers a flush although the memory was already released.

PrepareCommit() has the same gap on failure: it refreshes the memory only after the writer's PrepareCommit() succeeded, although the writer may have flushed its buffer before failing.

Expected the memory of the writer to be refreshed after Compact(), and after the writer's PrepareCommit() whether or not it succeeded.

Anything else?

Code: src/paimon/core/operation/abstract_file_store_write.cpp, AbstractFileStoreWrite::Compact() and AbstractFileStoreWrite::PrepareCommit(). Append-only writers with write buffers would hit the same gap.

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