[Fix](ai) Fix _exec_plan_fragment_impl meet unknown error when call AI_Functions#58363
Merged
yiguolei merged 3 commits intoapache:masterfrom Nov 28, 2025
Merged
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
zclllyybb
reviewed
Nov 25, 2025
Contributor
zclllyybb
left a comment
There was a problem hiding this comment.
问题关键在于_exec_plan_fragment_in_pthread这里为啥没命中
catch (const Exception& e) {
st = e.to_status();
这块代码。理论上内部return和throw都预期能正常传递完整错误信息,不需要强行统一。
Contributor
FE UT Coverage ReportIncrement line coverage |
5501b2a to
2b9138d
Compare
yiguolei
reviewed
Nov 27, 2025
2b9138d to
d2ff9e7
Compare
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 34267 ms |
TPC-DS: Total hot run time: 182586 ms |
ClickBench: Total hot run time: 27.3 s |
Contributor
FE UT Coverage ReportIncrement line coverage |
e01fde7 to
734f0ed
Compare
Contributor
Author
|
run buildall |
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
yiguolei
approved these changes
Nov 28, 2025
TPC-H: Total hot run time: 34378 ms |
TPC-DS: Total hot run time: 182087 ms |
ClickBench: Total hot run time: 27.69 s |
Contributor
FE Regression Coverage ReportIncrement line coverage |
Contributor
|
skip check_coverage |
linrrzqqq
added a commit
to linrrzqqq/doris
that referenced
this pull request
Nov 28, 2025
…I_Functions (apache#58363) Issue Number: close #xxx Related PR: #xxx Problem Summary: When a query statement contains some Commands(e.g. `UPDATE`), it will cause the AI function call to not go through `NereidsCoordinator` and fallback to `Coordinator`. In this case, the FE will not send `AI_Resources` to the BE, which will lead to errors in subsequent queries and the error messages will not be clear. This pr also replace every directly `throw Status` with `throw Exception(Status...), so the errors can be surfaced as `Exception`, not raw `Status` ```text I20251114 18:00:45.502351 59053 fragment_mgr.cpp:716] query_id: 5c963987bf8340bc-a56b019c8b0b3300, coord_addr: TNetworkAddress(hostname=172.17.6.136, port=9020), total fragment num on current host: 1, fe process uuid: 1763114220687, query type: SELECT, report audit fe:TNetworkAddress(hostname=172.17.6.136, port=9020), use wg:1763112792749,normal W20251114 18:00:45.528087 59053 status.h:438] meet error status: [INTERNAL_ERROR]AI resources not found 0# doris::vectorized::AIFunction<doris::vectorized::FunctionAITranslate>::_init_from_resource(doris::FunctionContext*, doris::vectorized::Block const&, std::vector<unsigned int, std::allocator<unsigned int> > const&, doris::TAIResource&, std::shared_ptr<doris::vectorized::AIAdapter>&) at /home/zcp/repo_center/doris_release/doris/be/src/runtime/query_context.h:268 1# doris::vectorized::AIFunction<doris::vectorized::FunctionAITranslate>::execute_impl(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned int, std::allocator<unsigned int> > const&, unsigned int, unsigned long) const at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:524 2# non-virtual thunk to doris::vectorized::AIFunction<doris::vectorized::FunctionAITranslate>::execute_impl(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned int, std::allocator<unsigned int> > const&, unsigned int, unsigned long) const at /home/zcp/repo_center/doris_release/doris/be/src/vec/functions/ai/ai_functions.h:0 3# doris::vectorized::PreparedFunctionImpl::default_implementation_for_constant_arguments(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned int, std::allocator<unsigned int> > const&, unsigned int, unsigned long, bool, bool*) const at /home/zcp/repo_center/doris_release/doris/be/src/vec/common/cow.h:0 4# doris::vectorized::PreparedFunctionImpl::execute_without_low_cardinality_columns(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned int, std::allocator<unsigned int> > const&, unsigned int, unsigned long, bool) const at /home/zcp/repo_center/doris_release/doris/be/src/vec/functions/function.cpp:0 5# doris::vectorized::PreparedFunctionImpl::execute(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned int, std::allocator<unsigned int> > const&, unsigned int, unsigned long, bool) const at /home/zcp/repo_center/doris_release/doris/be/src/vec/functions/function.cpp:249 6# doris::vectorized::IFunctionBase::execute(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned int, std::allocator<unsigned int> > const&, unsigned int, unsigned long, bool) const at /home/zcp/repo_center/doris_release/doris/be/src/vec/functions/function.h:192 7# doris::vectorized::VectorizedFnCall::_do_execute(doris::vectorized::VExprContext*, doris::vectorized::Block*, int*, std::vector<unsigned int, std::allocator<unsigned int> >&) at /home/zcp/repo_center/doris_release/doris/be/src/vec/exprs/vectorized_fn_call.cpp:238 8# doris::vectorized::VectorizedFnCall::execute(doris::vectorized::VExprContext*, doris::vectorized::Block*, int*) at /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/stl_vector.h:375 9# doris::vectorized::VExpr::get_const_col(doris::vectorized::VExprContext*, std::shared_ptr<doris::ColumnPtrWrapper>*) at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:524 10# doris::vectorized::VectorizedFnCall::open(doris::RuntimeState*, doris::vectorized::VExprContext*, doris::FunctionContext::FunctionStateScope) at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:524 11# doris::vectorized::VExprContext::open(doris::RuntimeState*) at /home/zcp/repo_center/doris_release/doris/be/src/vec/exprs/vexpr_context.cpp:0 12# doris::vectorized::VExpr::open(std::vector<std::shared_ptr<doris::vectorized::VExprContext>, std::allocator<std::shared_ptr<doris::vectorized::VExprContext> > > const&, doris::RuntimeState*) at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:524 13# doris::pipeline::UnionSourceOperatorX::prepare(doris::RuntimeState*) at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:524 14# doris::pipeline::Pipeline::prepare(doris::RuntimeState*) at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:524 15# doris::pipeline::PipelineFragmentContext::prepare(doris::ThreadPool*) at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:524 16# doris::FragmentMgr::exec_plan_fragment(doris::TPipelineFragmentParams const&, doris::QuerySource, std::function<void (doris::RuntimeState*, doris::Status*)> const&, doris::TPipelineFragmentParamsList const&) at /home/zcp/repo_center/doris_release/doris/be/src/runtime/fragment_mgr.cpp:0 17# doris::FragmentMgr::exec_plan_fragment(doris::TPipelineFragmentParams const&, doris::QuerySource, doris::TPipelineFragmentParamsList const&) at /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:245 18# doris::PInternalService::_exec_plan_fragment_impl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, doris::PFragmentRequestVersion, bool, std::function<void (doris::RuntimeState*, doris::Status*)> const&) at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:524 19# doris::PInternalService::_exec_plan_fragment_in_pthread(google::protobuf::RpcController*, doris::PExecPlanFragmentRequest const*, doris::PExecPlanFragmentResult*, google::protobuf::Closure*) at /home/zcp/repo_center/doris_release/doris/be/src/service/internal_service.cpp:0 20# doris::WorkThreadPool<false>::work_thread(int) at /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/atomic_base.h:641 21# execute_native_thread_routine 22# start_thread 23# clone I20251114 18:00:45.528275 59053 pipeline_fragment_context.cpp:139] PipelineFragmentContext::~PipelineFragmentContext|query_id=5c963987bf8340bc-a56b019c8b0b3300|fragment_id=0 I20251114 18:00:45.528398 59053 query_context.cpp:240] Query 5c963987bf8340bc-a56b019c8b0b3300 deconstructed, mem_tracker: W20251114 18:00:45.531440 59053 status.h:456] meet error status: [INTERNAL_ERROR]_exec_plan_fragment_impl meet unknown error 0# doris::PInternalService::_exec_plan_fragment_in_pthread(google::protobuf::RpcController*, doris::PExecPlanFragmentRequest const*, doris::PExecPlanFragmentResult*, google::protobuf::Closure*) at /home/zcp/repo_center/doris_release/doris/be/src/service/internal_service.cpp:0 1# doris::WorkThreadPool<false>::work_thread(int) at /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/atomic_base.h:641 2# execute_native_thread_routine 3# start_thread 4# clone W20251114 18:00:45.531484 59053 internal_service.cpp:351] exec plan fragment failed, errmsg=[INTERNAL_ERROR]_exec_plan_fragment_impl meet unknown error ``` - Test <!-- At least one of them must be included. --> - [ ] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [ ] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
nagisa-kunhah
pushed a commit
to nagisa-kunhah/doris
that referenced
this pull request
Dec 14, 2025
…I_Functions (apache#58363) ### What problem does this PR solve? Issue Number: close #xxx Related PR: #xxx Problem Summary: When a query statement contains some Commands(e.g. `UPDATE`), it will cause the AI function call to not go through `NereidsCoordinator` and fallback to `Coordinator`. In this case, the FE will not send `AI_Resources` to the BE, which will lead to errors in subsequent queries and the error messages will not be clear. This pr also replace every directly `throw Status` with `throw Exception(Status...), so the errors can be surfaced as `Exception`, not raw `Status` ```text I20251114 18:00:45.502351 59053 fragment_mgr.cpp:716] query_id: 5c963987bf8340bc-a56b019c8b0b3300, coord_addr: TNetworkAddress(hostname=172.17.6.136, port=9020), total fragment num on current host: 1, fe process uuid: 1763114220687, query type: SELECT, report audit fe:TNetworkAddress(hostname=172.17.6.136, port=9020), use wg:1763112792749,normal W20251114 18:00:45.528087 59053 status.h:438] meet error status: [INTERNAL_ERROR]AI resources not found 0# doris::vectorized::AIFunction<doris::vectorized::FunctionAITranslate>::_init_from_resource(doris::FunctionContext*, doris::vectorized::Block const&, std::vector<unsigned int, std::allocator<unsigned int> > const&, doris::TAIResource&, std::shared_ptr<doris::vectorized::AIAdapter>&) at /home/zcp/repo_center/doris_release/doris/be/src/runtime/query_context.h:268 1# doris::vectorized::AIFunction<doris::vectorized::FunctionAITranslate>::execute_impl(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned int, std::allocator<unsigned int> > const&, unsigned int, unsigned long) const at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:524 2# non-virtual thunk to doris::vectorized::AIFunction<doris::vectorized::FunctionAITranslate>::execute_impl(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned int, std::allocator<unsigned int> > const&, unsigned int, unsigned long) const at /home/zcp/repo_center/doris_release/doris/be/src/vec/functions/ai/ai_functions.h:0 3# doris::vectorized::PreparedFunctionImpl::default_implementation_for_constant_arguments(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned int, std::allocator<unsigned int> > const&, unsigned int, unsigned long, bool, bool*) const at /home/zcp/repo_center/doris_release/doris/be/src/vec/common/cow.h:0 4# doris::vectorized::PreparedFunctionImpl::execute_without_low_cardinality_columns(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned int, std::allocator<unsigned int> > const&, unsigned int, unsigned long, bool) const at /home/zcp/repo_center/doris_release/doris/be/src/vec/functions/function.cpp:0 5# doris::vectorized::PreparedFunctionImpl::execute(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned int, std::allocator<unsigned int> > const&, unsigned int, unsigned long, bool) const at /home/zcp/repo_center/doris_release/doris/be/src/vec/functions/function.cpp:249 6# doris::vectorized::IFunctionBase::execute(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned int, std::allocator<unsigned int> > const&, unsigned int, unsigned long, bool) const at /home/zcp/repo_center/doris_release/doris/be/src/vec/functions/function.h:192 7# doris::vectorized::VectorizedFnCall::_do_execute(doris::vectorized::VExprContext*, doris::vectorized::Block*, int*, std::vector<unsigned int, std::allocator<unsigned int> >&) at /home/zcp/repo_center/doris_release/doris/be/src/vec/exprs/vectorized_fn_call.cpp:238 8# doris::vectorized::VectorizedFnCall::execute(doris::vectorized::VExprContext*, doris::vectorized::Block*, int*) at /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/stl_vector.h:375 9# doris::vectorized::VExpr::get_const_col(doris::vectorized::VExprContext*, std::shared_ptr<doris::ColumnPtrWrapper>*) at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:524 10# doris::vectorized::VectorizedFnCall::open(doris::RuntimeState*, doris::vectorized::VExprContext*, doris::FunctionContext::FunctionStateScope) at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:524 11# doris::vectorized::VExprContext::open(doris::RuntimeState*) at /home/zcp/repo_center/doris_release/doris/be/src/vec/exprs/vexpr_context.cpp:0 12# doris::vectorized::VExpr::open(std::vector<std::shared_ptr<doris::vectorized::VExprContext>, std::allocator<std::shared_ptr<doris::vectorized::VExprContext> > > const&, doris::RuntimeState*) at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:524 13# doris::pipeline::UnionSourceOperatorX::prepare(doris::RuntimeState*) at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:524 14# doris::pipeline::Pipeline::prepare(doris::RuntimeState*) at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:524 15# doris::pipeline::PipelineFragmentContext::prepare(doris::ThreadPool*) at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:524 16# doris::FragmentMgr::exec_plan_fragment(doris::TPipelineFragmentParams const&, doris::QuerySource, std::function<void (doris::RuntimeState*, doris::Status*)> const&, doris::TPipelineFragmentParamsList const&) at /home/zcp/repo_center/doris_release/doris/be/src/runtime/fragment_mgr.cpp:0 17# doris::FragmentMgr::exec_plan_fragment(doris::TPipelineFragmentParams const&, doris::QuerySource, doris::TPipelineFragmentParamsList const&) at /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:245 18# doris::PInternalService::_exec_plan_fragment_impl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, doris::PFragmentRequestVersion, bool, std::function<void (doris::RuntimeState*, doris::Status*)> const&) at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:524 19# doris::PInternalService::_exec_plan_fragment_in_pthread(google::protobuf::RpcController*, doris::PExecPlanFragmentRequest const*, doris::PExecPlanFragmentResult*, google::protobuf::Closure*) at /home/zcp/repo_center/doris_release/doris/be/src/service/internal_service.cpp:0 20# doris::WorkThreadPool<false>::work_thread(int) at /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/atomic_base.h:641 21# execute_native_thread_routine 22# start_thread 23# clone I20251114 18:00:45.528275 59053 pipeline_fragment_context.cpp:139] PipelineFragmentContext::~PipelineFragmentContext|query_id=5c963987bf8340bc-a56b019c8b0b3300|fragment_id=0 I20251114 18:00:45.528398 59053 query_context.cpp:240] Query 5c963987bf8340bc-a56b019c8b0b3300 deconstructed, mem_tracker: W20251114 18:00:45.531440 59053 status.h:456] meet error status: [INTERNAL_ERROR]_exec_plan_fragment_impl meet unknown error 0# doris::PInternalService::_exec_plan_fragment_in_pthread(google::protobuf::RpcController*, doris::PExecPlanFragmentRequest const*, doris::PExecPlanFragmentResult*, google::protobuf::Closure*) at /home/zcp/repo_center/doris_release/doris/be/src/service/internal_service.cpp:0 1# doris::WorkThreadPool<false>::work_thread(int) at /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/atomic_base.h:641 2# execute_native_thread_routine 3# start_thread 4# clone W20251114 18:00:45.531484 59053 internal_service.cpp:351] exec plan fragment failed, errmsg=[INTERNAL_ERROR]_exec_plan_fragment_impl meet unknown error ``` ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [ ] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [ ] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
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.
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
When a query statement contains some Commands(e.g.
UPDATE), it will cause the AI function call to not go throughNereidsCoordinatorand fallback toCoordinator. In this case, the FE will not sendAI_Resourcesto the BE, which will lead to errors in subsequent queries and the error messages will not be clear.This pr also replace every directly
throw Statuswiththrow Exception(Status...), so the errors can be surfaced asException, not rawStatus`Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)