Uh oh!
There was an error while loading. Please reload this page.
branch-4.1: [fix](paimon) manage JNI writer lifecycle and spill - #66612
Conversation
hello-stephen
commented
Aug 10, 2026
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
suxiaogang223
commented
Aug 10, 2026
run buildall |
1 similar comment
suxiaogang223
commented
Aug 11, 2026
run buildall |
hello-stephen
commented
Aug 11, 2026
FE UT Coverage ReportIncrement line coverage `` 🎉 |
hello-stephen
commented
Aug 11, 2026
FE Regression Coverage ReportIncrement line coverage |
suxiaogang223
commented
Aug 12, 2026
/review |
There was a problem hiding this comment.
Requesting changes: six correctness gaps remain in the new managed Paimon spill integration.
Critical checkpoints:
- Native/JNI lifecycle:
ScopedEnvattachment ownership, TLS invalidation, references, and signatures look correct. However, Paimon close cancellation does not join compaction before C++ releases the native spill callback. - Spill configuration and placement:
write-buffer-spillable=falseunnecessarily requires a usable spill root, while spillable writers are pinned to one disk without fallback. - Accounting and cleanup: lookup resets can leave deleted files charged, while lookup and clustering SST raw I/O bypasses capacity enforcement and metrics.
- Regression coverage: the lifecycle test can pass the pre-fix bounded leak, and the added tests do not exercise these spill modes and failure paths.
No additional user focus was supplied; the whole 12-file change was reviewed. Three convergence rounds completed, and the final round reported no new valuable findings. This was a review-only task; builds and tests were not run per the runner instructions.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
suxiaogang223
commented
Aug 13, 2026
run buildall |
hello-stephen
commented
Aug 13, 2026
FE UT Coverage ReportIncrement line coverage `` 🎉 |
hello-stephen
commented
Aug 13, 2026
FE Regression Coverage ReportIncrement line coverage |
suxiaogang223
commented
Aug 14, 2026
run buildall |
hello-stephen
commented
Aug 14, 2026
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Aug 14, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Aug 14, 2026
FE Regression Coverage ReportIncrement line coverage |
4e2184d to
5a3a6feComparesuxiaogang223
commented
Aug 19, 2026
run buildall |
suxiaogang223
commented
Aug 19, 2026
/review |
Codex automated review failed and did not complete. Error: All Codex review accounts are usage-limited; earliest retry is 2026-08-20T03:35:00Z. Please trigger /review again after that time. |
hello-stephen
commented
Aug 19, 2026
FE UT Coverage ReportIncrement line coverage `` 🎉 |
baa3a98 to
b20dce8Comparesuxiaogang223
commented
Aug 21, 2026
run buildall |
b20dce8 to
a6e1b8fComparesuxiaogang223
commented
Aug 24, 2026
run buildall |
suxiaogang223
commented
Aug 25, 2026
run buildall |
1 similar comment
suxiaogang223
commented
Aug 25, 2026
run buildall |
suxiaogang223
commented
Aug 25, 2026
/review |
There was a problem hiding this comment.
Requesting changes for three additional non-duplicate issues.
Correctness and accounting: a failed physical spill cleanup is logged and suppressed, after which native close releases the session accounting and query-directory lease while residual files still occupy the disk. Performance: every non-empty input block synchronously performs a mutex-held recursive stat of every managed spill tree. Regression coverage: the refreshed external-path assertion checks only allowed-root membership and no longer proves round-robin advancement.
I also traced JNI ABI/reference ownership, partial-open and abort cleanup, executor quiescence, lazy/no-root behavior, multi-root capacity, raw lookup/clustering and reset accounting, and the warmed thread-lifecycle oracle. Those remaining concerns are either covered by the six existing live inline threads or were disproved; I did not duplicate them. No additional user-provided review focus was supplied.
This static review used the authoritative bundled diff plus the exact Paimon 1.4.2 upstream paths. No builds or tests were run, per the review instructions. The final M2-M4 set converged in round 3 after round 2 removed an unsupported race candidate, and the live PR head/base and duplicate fence were reverified immediately before submission.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
suxiaogang223
commented
Aug 25, 2026
run buildall |
1 similar comment
suxiaogang223
commented
Aug 26, 2026
run buildall |
suxiaogang223
commented
Aug 26, 2026
/review |
There was a problem hiding this comment.
Requesting changes for five newly substantiated issues on the bundled head: a reconciliation snapshot race that can double-charge callback-managed files; silent Iceberg data loss when spill-footer reservation fails; a global registry lock held across recursive deletion; reconciliation failures that can bypass abort for drained Paimon commit messages; and a post-quiescence accounting error that abandons prepared files and permanently fences later Paimon writers.
Critical checkpoints reviewed: native spill accounting and reservation rollback, multi-root/session ownership and query teardown, regular spill finalization/readback, Paimon executor quiescence, JNI partial-open/close cleanup, Java prepare/abort semantics, ABI/signature compatibility, memory-only lazy initialization, and the changed unit/regression oracles. Existing live threads and raw review comments were duplicate-fenced; no additional user focus was specified. The review is complete for head 61dbad4 after the required convergence round, subject to final API submission verification.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
61dbad4 to
d65a910Comparesuxiaogang223
commented
Aug 26, 2026
run buildall |
hello-stephen
commented
Aug 26, 2026
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Aug 26, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
Uh oh!
There was an error while loading. Please reload this page.
PR approved by at least one committer and no changes requested. |
### What problem does this PR solve? Issue Number: closeapache#65086 Related PR: apache#65868, apache#66612, apache#66810 Problem Summary: Add the BE Paimon sink, JNI writer backend, Java writer, commit payload transport, and worktree-local spill and memory lifecycle support required to write Paimon tables from master. ### Release note Support writing Apache Paimon tables through the native Doris execution pipeline. ### Check List (For Author) - Test: Static validation - BE clang-format/check-format and FE checkstyle; full build and tests are deferred until all forward-port picks are complete - Behavior changed: Yes, adds Paimon table writes - Does this need documentation: Yes, documentation can follow separately
What problem does this PR solve?
Paimon JNI writers can create write-buffer, lookup, and clustering temporary files while background compaction tasks are still running. Previously, those files were not owned by Doris query spill lifecycle, and native callbacks or memory could be released before all Java tasks had stopped.
This PR fixes the lifecycle and spill-management issues: