Skip to content

Conversation

@linrrzqqq
Copy link
Contributor

@linrrzqqq linrrzqqq commented Nov 25, 2025

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`

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

    • 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
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@linrrzqqq linrrzqqq requested a review from zclllyybb as a code owner November 25, 2025 11:41
@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@linrrzqqq
Copy link
Contributor Author

run buildall

Copy link
Contributor

@zclllyybb zclllyybb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

问题关键在于_exec_plan_fragment_in_pthread这里为啥没命中

catch (const Exception& e) {
        st = e.to_status();

这块代码。理论上内部return和throw都预期能正常传递完整错误信息,不需要强行统一。

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 42.86% (3/7) 🎉
Increment coverage report
Complete coverage report

@yiguolei yiguolei added the usercase Important user case type label label Nov 28, 2025
@linrrzqqq linrrzqqq force-pushed the fix-not-find-AIresource branch from 2b9138d to d2ff9e7 Compare November 28, 2025 03:27
@linrrzqqq
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 34267 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit d2ff9e7a60c66e1cab336f09065bd7196561ada8, data reload: false

------ Round 1 ----------------------------------
q1	17656	5056	4901	4901
q2	2043	317	216	216
q3	10271	1331	749	749
q4	10229	864	364	364
q5	7574	2495	2231	2231
q6	212	172	137	137
q7	943	782	640	640
q8	9352	1350	1016	1016
q9	7160	5368	5382	5368
q10	6920	2227	1883	1883
q11	506	315	290	290
q12	385	388	235	235
q13	17810	3674	3038	3038
q14	240	242	208	208
q15	590	519	510	510
q16	898	869	822	822
q17	629	868	384	384
q18	7543	7275	7099	7099
q19	1676	974	566	566
q20	349	341	229	229
q21	3535	3224	2439	2439
q22	1020	1014	942	942
Total cold run time: 107541 ms
Total hot run time: 34267 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5020	4906	4931	4906
q2	323	402	320	320
q3	2184	2694	2314	2314
q4	1348	1729	1340	1340
q5	4235	4457	4549	4457
q6	228	183	134	134
q7	2058	1914	1854	1854
q8	2697	2586	2491	2491
q9	7566	7461	7563	7461
q10	3048	3291	2818	2818
q11	600	519	502	502
q12	692	741	611	611
q13	3516	4002	3423	3423
q14	294	317	297	297
q15	549	506	515	506
q16	906	922	903	903
q17	1335	1431	1433	1431
q18	8137	7549	7709	7549
q19	797	751	823	751
q20	2011	2099	1944	1944
q21	4782	4311	4201	4201
q22	1083	1024	967	967
Total cold run time: 53409 ms
Total hot run time: 51180 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 182586 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit d2ff9e7a60c66e1cab336f09065bd7196561ada8, data reload: false

query1	1043	434	400	400
query2	6586	1589	1556	1556
query3	6755	225	229	225
query4	25230	23089	23036	23036
query5	4523	621	487	487
query6	337	237	239	237
query7	4653	515	316	316
query8	312	251	256	251
query9	8752	2647	2645	2645
query10	501	357	305	305
query11	15416	15342	14531	14531
query12	197	126	114	114
query13	1693	571	456	456
query14	9360	5513	5482	5482
query15	220	208	189	189
query16	7551	703	478	478
query17	1252	778	632	632
query18	2035	439	347	347
query19	222	208	181	181
query20	133	129	124	124
query21	223	137	151	137
query22	3837	3968	3938	3938
query23	33553	32163	32151	32151
query24	8610	2404	2403	2403
query25	611	513	448	448
query26	1255	273	163	163
query27	2735	497	362	362
query28	4313	2159	2144	2144
query29	801	655	491	491
query30	312	248	213	213
query31	813	709	641	641
query32	84	72	73	72
query33	596	387	335	335
query34	826	880	533	533
query35	814	836	728	728
query36	889	920	828	828
query37	115	110	87	87
query38	3854	3853	3813	3813
query39	1471	1423	1409	1409
query40	226	127	119	119
query41	70	71	70	70
query42	124	114	113	113
query43	437	466	423	423
query44	1278	761	762	761
query45	196	192	190	190
query46	880	1016	652	652
query47	1681	1716	1656	1656
query48	396	418	323	323
query49	752	502	432	432
query50	665	702	407	407
query51	3800	3924	4031	3924
query52	113	115	105	105
query53	231	267	193	193
query54	310	282	273	273
query55	98	100	94	94
query56	339	322	325	322
query57	1141	1188	1095	1095
query58	297	282	273	273
query59	2308	2399	2364	2364
query60	347	354	344	344
query61	162	153	158	153
query62	770	727	672	672
query63	239	207	195	195
query64	4588	1226	920	920
query65	4083	4005	3972	3972
query66	1123	453	342	342
query67	15344	15122	15091	15091
query68	6037	972	623	623
query69	515	346	311	311
query70	1140	1061	989	989
query71	420	336	314	314
query72	5972	4919	5030	4919
query73	696	643	344	344
query74	8864	8837	8600	8600
query75	3055	3074	2592	2592
query76	3229	1129	717	717
query77	533	401	323	323
query78	9390	9689	8977	8977
query79	1042	808	612	612
query80	640	564	500	500
query81	497	268	234	234
query82	235	143	116	116
query83	264	256	263	256
query84	264	115	101	101
query85	883	567	544	544
query86	316	303	293	293
query87	4106	4160	4013	4013
query88	2855	2288	2318	2288
query89	393	336	304	304
query90	1791	235	221	221
query91	205	187	163	163
query92	80	69	65	65
query93	1044	1002	662	662
query94	689	482	340	340
query95	539	435	425	425
query96	531	545	287	287
query97	2646	2698	2577	2577
query98	252	226	219	219
query99	1337	1396	1291	1291
Total cold run time: 264941 ms
Total hot run time: 182586 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 27.3 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit d2ff9e7a60c66e1cab336f09065bd7196561ada8, data reload: false

query1	0.06	0.05	0.05
query2	0.09	0.05	0.05
query3	0.26	0.08	0.08
query4	1.60	0.11	0.11
query5	0.29	0.26	0.26
query6	1.15	0.66	0.64
query7	0.03	0.03	0.03
query8	0.06	0.04	0.04
query9	0.56	0.52	0.50
query10	0.57	0.56	0.56
query11	0.15	0.10	0.10
query12	0.15	0.11	0.12
query13	0.62	0.60	0.61
query14	0.99	0.99	0.97
query15	0.82	0.79	0.81
query16	0.42	0.42	0.39
query17	0.99	1.03	1.05
query18	0.24	0.21	0.21
query19	1.94	1.78	1.82
query20	0.02	0.02	0.02
query21	15.43	0.27	0.14
query22	4.80	0.05	0.05
query23	15.98	0.27	0.10
query24	1.59	0.55	0.29
query25	0.08	0.08	0.04
query26	0.14	0.13	0.13
query27	0.08	0.05	0.10
query28	3.34	1.20	1.03
query29	12.55	3.96	3.19
query30	0.28	0.13	0.14
query31	2.81	0.60	0.41
query32	3.22	0.54	0.46
query33	2.99	3.10	3.07
query34	16.96	5.13	4.51
query35	4.54	4.56	4.54
query36	0.66	0.50	0.49
query37	0.11	0.07	0.06
query38	0.07	0.04	0.04
query39	0.04	0.03	0.02
query40	0.18	0.15	0.14
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.03	0.03
Total cold run time: 97.02 s
Total hot run time: 27.3 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 42.86% (3/7) 🎉
Increment coverage report
Complete coverage report

@linrrzqqq linrrzqqq force-pushed the fix-not-find-AIresource branch from e01fde7 to 734f0ed Compare November 28, 2025 07:22
@linrrzqqq
Copy link
Contributor Author

run buildall

Copy link
Contributor

@zclllyybb zclllyybb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Nov 28, 2025
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@doris-robot
Copy link

TPC-H: Total hot run time: 34378 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 734f0edf87693440273fb6fe82a7564cf616a93d, data reload: false

------ Round 1 ----------------------------------
q1	17610	5059	4972	4972
q2	2031	349	213	213
q3	10217	1335	741	741
q4	10222	888	383	383
q5	7452	2557	2262	2262
q6	189	170	136	136
q7	968	769	654	654
q8	9352	1401	1051	1051
q9	7206	5324	5327	5324
q10	6898	2247	1829	1829
q11	541	309	302	302
q12	389	396	225	225
q13	17799	3677	3055	3055
q14	248	238	209	209
q15	602	518	510	510
q16	908	883	808	808
q17	608	762	537	537
q18	7499	7088	7074	7074
q19	1332	976	593	593
q20	358	346	227	227
q21	3897	3174	2323	2323
q22	1009	983	950	950
Total cold run time: 107335 ms
Total hot run time: 34378 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5003	4940	4915	4915
q2	337	405	321	321
q3	2187	2693	2332	2332
q4	1323	1774	1370	1370
q5	4298	4485	4642	4485
q6	218	189	129	129
q7	2119	2035	1884	1884
q8	2669	2566	2579	2566
q9	7549	7357	7427	7357
q10	3014	3300	2788	2788
q11	607	530	497	497
q12	696	769	634	634
q13	3466	3978	3328	3328
q14	307	294	276	276
q15	569	509	518	509
q16	944	963	886	886
q17	1209	1429	1425	1425
q18	7913	7746	7635	7635
q19	854	825	841	825
q20	2021	2088	1907	1907
q21	4947	4478	4181	4181
q22	1043	977	1001	977
Total cold run time: 53293 ms
Total hot run time: 51227 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 182087 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 734f0edf87693440273fb6fe82a7564cf616a93d, data reload: false

query1	1083	421	400	400
query2	6567	1590	1582	1582
query3	6754	230	223	223
query4	25109	23532	22981	22981
query5	5027	615	454	454
query6	342	227	221	221
query7	4668	516	301	301
query8	299	261	245	245
query9	8757	2598	2600	2598
query10	543	366	317	317
query11	15524	15166	14827	14827
query12	196	122	113	113
query13	1698	573	454	454
query14	9529	5488	5492	5488
query15	212	203	188	188
query16	7695	681	521	521
query17	1211	799	633	633
query18	2048	444	353	353
query19	243	211	183	183
query20	136	127	126	126
query21	228	136	118	118
query22	4180	4113	3916	3916
query23	32864	32259	32080	32080
query24	8496	2402	2347	2347
query25	649	549	501	501
query26	1278	277	172	172
query27	2711	505	368	368
query28	4358	2177	2176	2176
query29	811	650	531	531
query30	312	244	213	213
query31	828	721	629	629
query32	85	80	75	75
query33	615	411	379	379
query34	828	866	535	535
query35	852	811	744	744
query36	895	944	855	855
query37	122	106	90	90
query38	3895	3820	3852	3820
query39	1474	1400	1405	1400
query40	233	131	119	119
query41	64	62	62	62
query42	129	111	111	111
query43	438	448	426	426
query44	1284	762	769	762
query45	201	199	194	194
query46	875	999	641	641
query47	1716	1716	1676	1676
query48	390	414	317	317
query49	768	520	435	435
query50	665	706	420	420
query51	4039	3953	3891	3891
query52	111	111	104	104
query53	256	260	191	191
query54	302	295	278	278
query55	99	94	91	91
query56	359	344	321	321
query57	1151	1159	1100	1100
query58	289	286	272	272
query59	2377	2485	2297	2297
query60	380	369	337	337
query61	162	157	158	157
query62	785	728	641	641
query63	232	195	192	192
query64	4518	1223	907	907
query65	4063	3993	3988	3988
query66	1082	444	348	348
query67	15361	15257	14774	14774
query68	8387	963	632	632
query69	531	348	304	304
query70	1122	1041	989	989
query71	476	339	317	317
query72	5656	4911	5055	4911
query73	707	557	342	342
query74	8909	8542	8684	8542
query75	3752	3051	2575	2575
query76	3854	1123	711	711
query77	834	393	322	322
query78	9529	9675	8907	8907
query79	2014	840	581	581
query80	860	576	494	494
query81	498	268	246	246
query82	435	136	109	109
query83	290	260	250	250
query84	305	116	104	104
query85	935	496	453	453
query86	346	294	283	283
query87	4135	4055	3979	3979
query88	3029	2292	2282	2282
query89	386	330	301	301
query90	1974	223	221	221
query91	175	183	141	141
query92	83	72	69	69
query93	1180	1019	655	655
query94	727	443	347	347
query95	509	401	407	401
query96	504	556	286	286
query97	2666	2669	2638	2638
query98	234	218	207	207
query99	1442	1386	1279	1279
Total cold run time: 271935 ms
Total hot run time: 182087 ms

@doris-robot
Copy link

ClickBench: Total hot run time: 27.69 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 734f0edf87693440273fb6fe82a7564cf616a93d, data reload: false

query1	0.05	0.04	0.05
query2	0.10	0.06	0.05
query3	0.25	0.09	0.09
query4	1.61	0.12	0.11
query5	0.27	0.26	0.24
query6	1.17	0.64	0.63
query7	0.04	0.03	0.03
query8	0.06	0.04	0.05
query9	0.59	0.53	0.51
query10	0.57	0.56	0.55
query11	0.17	0.10	0.11
query12	0.14	0.12	0.11
query13	0.63	0.61	0.62
query14	0.99	0.96	0.96
query15	0.83	0.79	0.82
query16	0.39	0.42	0.40
query17	0.99	1.05	1.04
query18	0.23	0.21	0.21
query19	1.95	1.87	1.92
query20	0.02	0.01	0.01
query21	15.46	0.27	0.13
query22	4.72	0.06	0.04
query23	15.84	0.27	0.10
query24	1.19	0.53	0.76
query25	0.09	0.05	0.06
query26	0.14	0.14	0.14
query27	0.07	0.05	0.06
query28	5.08	1.22	1.01
query29	12.55	3.88	3.25
query30	0.28	0.13	0.11
query31	2.82	0.60	0.39
query32	3.24	0.56	0.47
query33	3.04	3.05	3.12
query34	16.99	5.21	4.55
query35	4.59	4.58	4.59
query36	0.67	0.50	0.51
query37	0.11	0.07	0.07
query38	0.07	0.04	0.04
query39	0.05	0.03	0.03
query40	0.18	0.14	0.13
query41	0.08	0.04	0.02
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 98.39 s
Total hot run time: 27.69 s

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 85.71% (6/7) 🎉
Increment coverage report
Complete coverage report

@yiguolei yiguolei closed this Nov 28, 2025
@yiguolei yiguolei reopened this Nov 28, 2025
@yiguolei
Copy link
Contributor

skip check_coverage

@yiguolei yiguolei merged commit f96e22c into apache:master Nov 28, 2025
39 of 42 checks passed
@linrrzqqq linrrzqqq deleted the fix-not-find-AIresource branch November 28, 2025 13:13
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 -->
yiguolei pushed a commit that referenced this pull request Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/4.0.x dev/4.0.x-conflict reviewed usercase Important user case type label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants