Skip to content

[tiering] Fix Paimon IOManager leak in MergeTreeWriter#3190

Merged
luoyuxia merged 1 commit intoapache:mainfrom
luoyuxia:fix-paimon-ioManager-leak
Apr 27, 2026
Merged

[tiering] Fix Paimon IOManager leak in MergeTreeWriter#3190
luoyuxia merged 1 commit intoapache:mainfrom
luoyuxia:fix-paimon-ioManager-leak

Conversation

@luoyuxia
Copy link
Copy Markdown
Contributor

@luoyuxia luoyuxia commented Apr 24, 2026

  • Yes (Claude Code - Claude Opus 4.6)

Purpose

Fix Paimon IOManager resource leak in MergeTreeWriter that causes paimon-io-<UUID> temp directories to accumulate in /tmp and eventually exhaust disk space when tiering service is running.

Brief change log

The IOManager created in MergeTreeWriter.createTableWrite() was passed inline to withIOManager() without keeping a reference. Since Paimon's TableWriteImpl does not own the IOManager lifecycle, the IOManager was never closed when the writer was closed, leaving paimon-io-<UUID> directories behind in /tmp after each tiering task.

  • Store the IOManager as a field in MergeTreeWriter
  • Override close() to explicitly close the IOManager in a finally block, ensuring temp directories are cleaned up even if tableWrite.close() throws

Tests

  • Existing tiering-related integration tests cover the write/close flow
  • Manual verification: start tiering service with PK tables and confirm paimon-io-* directories in /tmp are cleaned up after writer closes

API and Format

No API or storage format changes.

Documentation

No documentation changes needed.

…isk exhaustion

The IOManager created in MergeTreeWriter.createTableWrite() was passed
inline to withIOManager() without keeping a reference. Since Paimon's
TableWriteImpl does not own the IOManager lifecycle, it was never closed,
leaving paimon-io-<UUID> directories in /tmp after each tiering task.

This fix stores the IOManager as a field and explicitly closes it in
close() via a finally block, ensuring temp directories are cleaned up.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@beryllw
Copy link
Copy Markdown
Contributor

beryllw commented Apr 26, 2026

LGTM

@luoyuxia luoyuxia merged commit 36f6760 into apache:main Apr 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants