Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](multi table) fix single stream multi table memory leak #38255

Merged
merged 2 commits into from
Jul 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions be/src/io/fs/multi_table_pipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,19 @@ void MultiTablePipe::_handle_consumer_finished() {
_ctx->number_filtered_rows = _number_filtered_rows;
_ctx->number_unselected_rows = _number_unselected_rows;
_ctx->commit_infos = _tablet_commit_infos;

// remove ctx to avoid memory leak.
for (const auto& pair : _planned_tables) {
if (pair.second) {
doris::ExecEnv::GetInstance()->new_load_stream_mgr()->remove(pair.second->id);
}
}
for (const auto& pair : _unplanned_tables) {
if (pair.second) {
doris::ExecEnv::GetInstance()->new_load_stream_mgr()->remove(pair.second->id);
}
}

LOG(INFO) << "all plan for multi-table load complete. number_total_rows="
<< _ctx->number_total_rows << " number_loaded_rows=" << _ctx->number_loaded_rows
<< " number_filtered_rows=" << _ctx->number_filtered_rows
Expand Down
Loading