[fix](group commit) fix memory leak of pending InsertLoadJob in group commit http stream#62282
Open
sollhui wants to merge 1 commit intoapache:masterfrom
Open
[fix](group commit) fix memory leak of pending InsertLoadJob in group commit http stream#62282sollhui wants to merge 1 commit intoapache:masterfrom
sollhui wants to merge 1 commit intoapache:masterfrom
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
morrySnow
approved these changes
Apr 9, 2026
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
Contributor
FE UT Coverage ReportIncrement line coverage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #62118
Problem
When users use HTTP StreamLoad with
group_commit=async_mode, the BEinternally creates group commit batches via
GroupCommitTable::_create_group_commit_load,which sends a
streamLoadPutRPC to FE with a SQL like:INSERT INTO doris_internal_table_id(table_id) WITH LABEL group_commit_xxx
SELECT * FROM group_commit("table_id"="...")
FE processes this via
httpStreamPutImpl, which callsinitPlan()andregisters an
InsertLoadJobinLoadManagerwith PENDING state.However, this job never transitions to FINISHED/CANCELLED because:
httpStreamPutImplonly generates the plan and returns it to BE — itnever calls
executeSingleInsert().loadTxnCommitRPC, whichbypasses
LoadManagerentirely.isExpired()returns false for non-completed jobs, so these PENDINGjobs are never cleaned up.
This causes a steady memory leak in
LoadManager. The issue was introducedby #56412 and was partially fixed by #56852 (which only handled the case
where
ctx.isGroupCommit() == true). The internal group commit RPC doesnot set
group_commit_mode, soctx.isGroupCommit()remains false andthe fix in #56852 does not apply.
Fix
In
InsertIntoTableCommand.selectInsertExecutorFactory,detect when the INSERT source contains a
group_commit(...)TVF and setjobId = -1, preventingaddLoadJobfrom being called.