Skip to content

[fix](profile) guard execution profile access#65353

Merged
morningman merged 1 commit into
apache:masterfrom
shuke987:diagnose-profile-report-merge
Jul 9, 2026
Merged

[fix](profile) guard execution profile access#65353
morningman merged 1 commit into
apache:masterfrom
shuke987:diagnose-profile-report-merge

Conversation

@shuke987

@shuke987 shuke987 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

What

Fix two profile stability issues found while investigating
query_profile/adaptive_pipeline_task_serial_read_on_limit.groovy:

  • Guard ProfileManager.getExecutionProfile() with the existing read lock,
    matching the write-locked updates/removals of queryIdToExecutionProfiles.
  • Mark query_profile/dml_profile_safe.groovy as nonConcurrent because it runs
    clean all profile, which clears global FE profile state and can interfere
    with other profile suites that are waiting for a query profile to become
    complete.

Why

CI evidence showed dml_profile_safe.groovy running clean all profile while
adaptive_pipeline_task_serial_read_on_limit.groovy was waiting on another
query's profile. The final BE profile report then reached FE after the target
ExecutionProfile had already been cleared, so the profile never became
complete for the waiting case.

The read-lock change is a small product hardening fix: queryIdToExecutionProfiles
is a regular map guarded by the profile manager read/write lock, so reads should
also use the read lock.

Validation

  • git diff --check
  • PR diagnostic run before cleanup:
    • P0 Regression build 989990: SUCCESS
    • Cloud P0 build 989992: SUCCESS
  • Remote log scan on ci-selectdb for builds 989990 and 989992:
    • no final-report missing ExecutionProfile
    • no mark-finished missing ExecutionProfile
    • no clean all profile interference after isolating dml_profile_safe
    • sampled incomplete-profile logs were transient and later completed

Local FE build/regression was not run in this cleanup pass; validation is
expected from the refreshed PR pipeline.

@shuke987

shuke987 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

run buildall

@shuke987

shuke987 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@hello-stephen

Copy link
Copy Markdown
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?

@shuke987 shuke987 changed the title [diagnose](profile) log query profile merge failures [WIP][diagnose](profile) log query profile merge failures Jul 8, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found one issue that should be fixed before merging.

Critical checkpoint conclusions:

  • Goal: the PR adds diagnostics for query profile report handling, but the accepted issue makes one diagnostic WARN fire on an expected auto-profile-threshold cleanup path, so the signal is not reliable yet.
  • Scope: the code change is small and localized to ExecutionProfile and QeProcessorImpl.
  • Concurrency/lifecycle: the profile update remains asynchronous; no new locks or persistence paths were added. The concern is profile lifecycle cleanup versus late final BE profile reports.
  • Config/session compatibility: no new config was added. Existing auto_profile_threshold_ms behavior is directly involved in the accepted issue.
  • Parallel paths: realtime/final BE profile reporting and profile-manager cleanup paths were checked.
  • Tests/validation: no tests were run because this checkout lacks thirdparty/installed and thirdparty/installed/bin/protoc; git diff --check ab044d691635ea5d1e27daf72ee42d795ef6ab52 cd6884503b2c3eb0e08fffcaac119aa8f6001679 passed.

User focus: no additional user-provided review focus was supplied.

Subagent conclusions: OR-1 was accepted as the inline comment. TSC-1 was dismissed with evidence because the unsafe unset-map receive-log path is pre-existing and current BE creators always set fragment_id_to_profile when sending query_profile; older mixed-version BEs omit query_profile entirely. Convergence round 1 ended with both optimizer-rewrite and tests-session-config reporting NO_NEW_VALUABLE_FINDINGS for the same final ledger/comment set.

if (LOG.isDebugEnabled()) {
LOG.debug("Could not find execution profile, query {} be {}",
DebugUtil.printId(profile.query_id), address.toString());
if (isDone) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This turns an expected profile-filtering path into a WARN. The comment above still says missing execution profiles are common when auto_profile_threshold_ms != -1; for short queries Profile.updateSummary(..., true) removes the profile via ProfileManager.removeProfile(), and a final BE profile report that arrives after that cleanup reaches this branch with isDone=true. Those successful threshold-filtered queries will now emit WARN even though nothing is wrong, which makes the diagnostic noisy and can hide the real lost-profile case. Please keep the known filtered/cleaned-up miss at DEBUG, or only warn when the miss is distinguishable from intentional auto-profile cleanup, for example while the coordinator still exists.

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 3.77% (2/53) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17889	4025	4033	4025
q2	2080	325	219	219
q3	10215	1370	845	845
q4	4683	469	348	348
q5	7484	845	594	594
q6	185	171	135	135
q7	745	832	624	624
q8	9377	1538	1593	1538
q9	5563	4394	4370	4370
q10	6776	1790	1550	1550
q11	492	343	307	307
q12	733	533	425	425
q13	18086	3415	2705	2705
q14	273	274	246	246
q15	q16	785	789	717	717
q17	940	882	883	882
q18	7103	5919	5561	5561
q19	1315	1290	969	969
q20	758	655	519	519
q21	6280	2901	2658	2658
q22	447	379	313	313
Total cold run time: 102209 ms
Total hot run time: 29550 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5021	4779	4711	4711
q2	348	374	212	212
q3	4973	5321	4683	4683
q4	2072	2157	1381	1381
q5	4689	4869	4602	4602
q6	224	179	130	130
q7	1982	1817	1517	1517
q8	2321	2037	2059	2037
q9	7622	7366	7186	7186
q10	4633	4654	4209	4209
q11	519	376	347	347
q12	726	751	578	578
q13	2956	3265	2744	2744
q14	274	286	256	256
q15	q16	691	699	604	604
q17	1270	1238	1232	1232
q18	7199	6846	6720	6720
q19	1123	1057	1070	1057
q20	2231	2221	1970	1970
q21	5247	4522	4381	4381
q22	526	450	416	416
Total cold run time: 56647 ms
Total hot run time: 50973 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 179642 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 cd6884503b2c3eb0e08fffcaac119aa8f6001679, data reload: false

query5	4311	643	485	485
query6	455	219	197	197
query7	4876	606	337	337
query8	344	183	168	168
query9	8773	4069	4047	4047
query10	448	358	301	301
query11	5794	2340	2115	2115
query12	158	102	100	100
query13	1254	613	450	450
query14	6319	5272	4937	4937
query14_1	4284	4256	4278	4256
query15	230	217	183	183
query16	1024	486	476	476
query17	1175	744	588	588
query18	2478	470	356	356
query19	207	194	156	156
query20	122	116	109	109
query21	235	157	137	137
query22	13564	13621	13366	13366
query23	17543	16597	16215	16215
query23_1	16376	16333	16228	16228
query24	7568	1758	1344	1344
query24_1	1297	1295	1319	1295
query25	572	462	386	386
query26	1321	338	207	207
query27	2610	603	388	388
query28	4427	2018	2019	2018
query29	1137	636	505	505
query30	338	258	219	219
query31	1128	1092	986	986
query32	112	64	62	62
query33	526	319	260	260
query34	1168	1131	654	654
query35	752	784	673	673
query36	1403	1399	1244	1244
query37	158	111	98	98
query38	1912	1719	1647	1647
query39	918	912	895	895
query39_1	889	862	905	862
query40	251	171	153	153
query41	63	62	63	62
query42	96	89	92	89
query43	315	325	280	280
query44	1386	789	772	772
query45	200	185	178	178
query46	1048	1281	723	723
query47	2377	2354	2278	2278
query48	402	407	300	300
query49	569	430	309	309
query50	1086	425	333	333
query51	10715	10673	10644	10644
query52	86	84	76	76
query53	253	273	196	196
query54	301	250	214	214
query55	82	70	65	65
query56	299	316	289	289
query57	1409	1407	1300	1300
query58	293	251	267	251
query59	1546	1620	1421	1421
query60	300	260	251	251
query61	169	170	146	146
query62	711	649	584	584
query63	238	203	204	203
query64	2801	1030	887	887
query65	4807	4776	4808	4776
query66	1837	502	379	379
query67	29694	28929	29317	28929
query68	3133	1679	1025	1025
query69	409	304	275	275
query70	1093	949	952	949
query71	349	336	300	300
query72	3060	2686	2425	2425
query73	876	813	449	449
query74	5067	4949	4760	4760
query75	2591	2653	2207	2207
query76	2353	1200	773	773
query77	352	388	279	279
query78	12346	12414	11729	11729
query79	1386	1179	741	741
query80	1284	522	457	457
query81	549	323	275	275
query82	650	158	119	119
query83	382	323	294	294
query84	295	161	129	129
query85	965	595	513	513
query86	433	289	289	289
query87	1832	1815	1756	1756
query88	3668	2805	2795	2795
query89	462	403	357	357
query90	1926	203	198	198
query91	200	191	161	161
query92	63	58	53	53
query93	1674	1524	1003	1003
query94	729	350	304	304
query95	786	579	483	483
query96	1021	819	375	375
query97	2677	2666	2558	2558
query98	223	202	198	198
query99	1145	1169	1050	1050
Total cold run time: 265995 ms
Total hot run time: 179642 ms

@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.11	0.05	0.05
query3	0.26	0.14	0.14
query4	1.61	0.14	0.14
query5	0.27	0.22	0.22
query6	1.22	1.05	1.11
query7	0.04	0.01	0.01
query8	0.06	0.04	0.04
query9	0.39	0.32	0.32
query10	0.54	0.54	0.54
query11	0.20	0.15	0.14
query12	0.20	0.15	0.15
query13	0.49	0.47	0.48
query14	1.05	1.01	0.99
query15	0.61	0.59	0.59
query16	0.32	0.30	0.31
query17	1.06	1.13	1.11
query18	0.22	0.21	0.21
query19	2.10	2.01	1.93
query20	0.02	0.01	0.01
query21	15.44	0.23	0.13
query22	4.86	0.05	0.05
query23	16.07	0.31	0.12
query24	2.91	0.44	0.33
query25	0.11	0.06	0.03
query26	0.73	0.21	0.16
query27	0.04	0.03	0.03
query28	3.52	0.91	0.54
query29	12.48	4.01	3.19
query30	0.27	0.16	0.16
query31	2.77	0.59	0.32
query32	3.23	0.60	0.49
query33	3.28	3.18	3.28
query34	15.59	4.18	3.51
query35	3.53	3.47	3.53
query36	0.56	0.42	0.42
query37	0.09	0.06	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.17	0.18	0.15
query41	0.08	0.04	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 96.68 s
Total hot run time: 24.92 s

@shuke987

shuke987 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17684	4081	4038	4038
q2	2020	322	201	201
q3	10347	1347	827	827
q4	4688	464	341	341
q5	7519	824	555	555
q6	202	170	133	133
q7	759	836	611	611
q8	10119	1408	1521	1408
q9	6110	4376	4334	4334
q10	7034	1777	1544	1544
q11	535	351	309	309
q12	750	538	426	426
q13	18156	3374	2723	2723
q14	265	267	246	246
q15	q16	786	772	709	709
q17	1020	962	886	886
q18	6805	5765	5580	5580
q19	1406	1279	970	970
q20	783	651	548	548
q21	5631	2687	2305	2305
q22	423	357	292	292
Total cold run time: 103042 ms
Total hot run time: 28986 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4393	4289	4305	4289
q2	288	318	213	213
q3	4543	4905	4369	4369
q4	2060	2122	1376	1376
q5	4423	4265	4284	4265
q6	224	174	126	126
q7	1689	1975	1692	1692
q8	2437	2099	2056	2056
q9	7800	7791	7670	7670
q10	4721	4646	4257	4257
q11	570	423	396	396
q12	726	738	543	543
q13	3447	3582	2897	2897
q14	331	337	290	290
q15	q16	705	744	685	685
q17	1330	1280	1285	1280
q18	7916	7286	6965	6965
q19	1087	1075	1083	1075
q20	2199	2222	1927	1927
q21	5196	4549	4402	4402
q22	516	465	398	398
Total cold run time: 56601 ms
Total hot run time: 51171 ms

@shuke987

shuke987 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 180109 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 1a90e4b1e49f9dfa0ee621b5b0be2bb5314532ea, data reload: false

query5	4357	652	482	482
query6	494	217	200	200
query7	4858	578	331	331
query8	350	188	170	170
query9	8775	3996	4002	3996
query10	454	335	291	291
query11	5969	2420	2142	2142
query12	171	101	98	98
query13	1287	609	427	427
query14	6259	5234	4921	4921
query14_1	4257	4266	4259	4259
query15	220	203	175	175
query16	1083	472	421	421
query17	1115	701	570	570
query18	2471	455	340	340
query19	217	185	144	144
query20	112	107	105	105
query21	239	160	128	128
query22	13668	13535	13386	13386
query23	17426	16568	16209	16209
query23_1	16280	16178	16293	16178
query24	7866	1741	1278	1278
query24_1	1317	1313	1280	1280
query25	559	456	396	396
query26	1325	361	207	207
query27	2595	575	393	393
query28	4471	2021	1982	1982
query29	1084	646	499	499
query30	339	268	226	226
query31	1131	1096	979	979
query32	116	64	63	63
query33	543	338	270	270
query34	1212	1152	676	676
query35	761	798	664	664
query36	1401	1355	1205	1205
query37	162	108	95	95
query38	1869	1708	1650	1650
query39	931	923	892	892
query39_1	894	892	908	892
query40	276	169	145	145
query41	71	70	67	67
query42	92	93	94	93
query43	327	323	275	275
query44	1443	788	786	786
query45	199	217	190	190
query46	1106	1182	767	767
query47	2400	2304	2323	2304
query48	399	399	295	295
query49	579	437	325	325
query50	1046	423	346	346
query51	10908	10859	10848	10848
query52	93	87	75	75
query53	264	282	206	206
query54	308	251	240	240
query55	75	74	69	69
query56	297	305	292	292
query57	1446	1415	1354	1354
query58	338	287	255	255
query59	1557	1677	1435	1435
query60	328	286	267	267
query61	182	176	170	170
query62	698	651	597	597
query63	245	208	208	208
query64	2882	1035	835	835
query65	4868	4752	4774	4752
query66	1894	515	399	399
query67	29471	28769	29163	28769
query68	3042	1521	1041	1041
query69	432	302	261	261
query70	1065	942	948	942
query71	346	314	320	314
query72	3099	2655	2442	2442
query73	905	790	421	421
query74	5126	4918	4733	4733
query75	2624	2573	2213	2213
query76	2298	1165	791	791
query77	362	383	277	277
query78	12404	12370	11775	11775
query79	2585	1223	745	745
query80	1795	553	463	463
query81	576	329	273	273
query82	624	156	124	124
query83	366	316	289	289
query84	281	153	132	132
query85	1012	604	544	544
query86	449	304	289	289
query87	1829	1816	1735	1735
query88	3768	2797	2785	2785
query89	463	400	357	357
query90	1888	205	203	203
query91	205	199	162	162
query92	66	62	55	55
query93	1863	1514	930	930
query94	791	360	316	316
query95	785	593	458	458
query96	1098	797	379	379
query97	2721	2689	2578	2578
query98	209	222	205	205
query99	1177	1175	1036	1036
Total cold run time: 268981 ms
Total hot run time: 180109 ms

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found one additional issue that should be fixed before merging.

Critical checkpoint conclusions:

  • Goal: the PR adds diagnostics for query profile report handling. Most changes are targeted logging/guarding, but the accepted issue makes a WARN fire during normal auto-profile cleanup, so one diagnostic signal is unreliable.
  • Scope: the change is localized to FE profile/reporting code in ExecutionProfile, ProfileManager, and QeProcessorImpl.
  • Concurrency/lifecycle: profile updates remain asynchronous, and the added read lock around getExecutionProfile matches the existing profile-manager lock model. The accepted issue is a lifecycle/log-level mismatch between Profile.updateSummary(..., true), removeProfile, and unregisterQuery.
  • Config/session compatibility: no new config was added. Existing auto_profile_threshold_ms behavior is directly involved in the accepted issue.
  • Parallel paths: the final BE profile report miss in QeProcessorImpl is already covered by existing thread discussion_r3541179558; the new inline comment covers the distinct FE-unregister warning path in ProfileManager.
  • Tests/validation: git diff --check passed after fetching the exact base SHA. FE build/checkstyle was not run because this checkout is missing thirdparty/installed and thirdparty/installed/bin/protoc.

User focus: no additional user-provided review focus was supplied.

Subagent conclusions: optimizer-rewrite-001 and tests-session-config-001 were merged into MAIN-001 and submitted as the inline comment. tests-session-config-001 was treated as a duplicate of MAIN-001; the existing QeProcessorImpl warning concern was duplicate-suppressed against discussion_r3541179558. Convergence round 1 ended with both optimizer-rewrite and tests-session-config reporting NO_NEW_VALUABLE_FINDINGS for the same final ledger/comment set.

if (execProfile == null) {
LOG.debug("Profile {} does not exist, already finished or does not enable profile",
DebugUtil.printId(queryId));
LOG.warn("Execution profile {} does not exist when marking query finished, {}",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is another expected auto-profile cleanup path that now logs at WARN. For a query that finishes under auto_profile_threshold_ms, StmtExecutor.finalizeQuery() calls updateProfile(true), Profile.updateSummary(..., true) removes the profile through ProfileManager.removeProfile(), and then finalizeQuery() immediately calls QeProcessorImpl.unregisterQuery(), which still reaches markExecutionProfileFinished(). At that point execProfile == null is intentional, so this warning will fire during normal FE unregister even before any final BE profile report is involved. Please keep the known removed/disabled-profile case at DEBUG, or only warn when the state proves the profile was not intentionally filtered.

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 24.95 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 1a90e4b1e49f9dfa0ee621b5b0be2bb5314532ea, data reload: false

query1	0.00	0.00	0.01
query2	0.10	0.05	0.05
query3	0.26	0.13	0.13
query4	1.61	0.14	0.14
query5	0.25	0.26	0.23
query6	1.27	1.06	1.05
query7	0.04	0.01	0.00
query8	0.06	0.03	0.03
query9	0.41	0.30	0.32
query10	0.54	0.54	0.54
query11	0.20	0.14	0.13
query12	0.20	0.14	0.14
query13	0.46	0.47	0.48
query14	1.03	1.01	1.01
query15	0.61	0.58	0.60
query16	0.33	0.33	0.30
query17	1.14	1.08	1.11
query18	0.23	0.24	0.22
query19	2.10	1.98	2.01
query20	0.02	0.01	0.01
query21	15.43	0.22	0.13
query22	4.83	0.05	0.05
query23	16.13	0.30	0.12
query24	3.03	0.44	0.32
query25	0.11	0.04	0.04
query26	0.73	0.20	0.14
query27	0.04	0.04	0.05
query28	3.53	0.85	0.52
query29	12.51	4.06	3.29
query30	0.27	0.16	0.15
query31	2.77	0.58	0.32
query32	3.22	0.60	0.48
query33	3.17	3.15	3.16
query34	15.44	4.24	3.52
query35	3.55	3.51	3.51
query36	0.55	0.43	0.44
query37	0.09	0.07	0.06
query38	0.04	0.04	0.03
query39	0.04	0.03	0.02
query40	0.18	0.17	0.15
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.68 s
Total hot run time: 24.95 s

@shuke987

shuke987 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17679	4037	4052	4037
q2	2107	345	204	204
q3	10168	1432	822	822
q4	4680	471	340	340
q5	7515	864	569	569
q6	179	170	135	135
q7	768	817	612	612
q8	9312	1603	1568	1568
q9	5597	4428	4381	4381
q10	6735	1791	1510	1510
q11	496	342	313	313
q12	701	553	425	425
q13	18161	3362	2783	2783
q14	266	261	237	237
q15	q16	793	777	705	705
q17	969	1055	975	975
q18	6805	5753	5603	5603
q19	1317	1332	1104	1104
q20	770	660	560	560
q21	6284	2818	2630	2630
q22	464	370	315	315
Total cold run time: 101766 ms
Total hot run time: 29828 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5245	4799	4756	4756
q2	295	341	214	214
q3	4913	5291	4693	4693
q4	2084	2177	1339	1339
q5	4732	4940	4614	4614
q6	230	172	127	127
q7	1851	1794	1555	1555
q8	2382	2071	2118	2071
q9	7635	7319	7201	7201
q10	4637	4591	4178	4178
q11	520	382	345	345
q12	726	735	571	571
q13	2927	3234	2841	2841
q14	270	283	249	249
q15	q16	674	688	614	614
q17	1260	1240	1234	1234
q18	7323	6670	6865	6670
q19	1070	1062	1036	1036
q20	2204	2190	1932	1932
q21	5223	4472	4357	4357
q22	542	443	412	412
Total cold run time: 56743 ms
Total hot run time: 51009 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 179913 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 52eea1e2c185ac182e1661a7a9197002b5d4085a, data reload: false

query5	4321	634	474	474
query6	455	219	204	204
query7	4871	608	344	344
query8	340	179	166	166
query9	8817	3963	3984	3963
query10	529	355	308	308
query11	5902	2333	2183	2183
query12	159	104	99	99
query13	1282	581	418	418
query14	6283	5293	4953	4953
query14_1	4280	4346	4249	4249
query15	215	199	183	183
query16	1032	470	475	470
query17	965	742	599	599
query18	2446	462	361	361
query19	221	190	159	159
query20	116	111	107	107
query21	241	152	133	133
query22	13620	13597	13276	13276
query23	17443	16531	16206	16206
query23_1	16333	16336	16267	16267
query24	7641	1781	1301	1301
query24_1	1326	1324	1285	1285
query25	576	480	385	385
query26	1346	359	211	211
query27	2656	555	372	372
query28	4440	2010	1993	1993
query29	1091	632	511	511
query30	360	265	226	226
query31	1130	1088	987	987
query32	121	71	62	62
query33	529	326	258	258
query34	1198	1147	662	662
query35	786	798	673	673
query36	1405	1438	1247	1247
query37	157	114	96	96
query38	1933	1709	1661	1661
query39	961	909	883	883
query39_1	895	881	895	881
query40	261	155	134	134
query41	65	61	61	61
query42	92	90	92	90
query43	320	318	283	283
query44	1410	755	756	755
query45	195	189	177	177
query46	1053	1207	733	733
query47	2374	2353	2242	2242
query48	405	378	298	298
query49	575	405	310	310
query50	999	415	321	321
query51	10852	10722	10605	10605
query52	85	83	73	73
query53	254	268	204	204
query54	310	230	210	210
query55	76	71	66	66
query56	290	281	284	281
query57	1436	1411	1334	1334
query58	298	259	234	234
query59	1562	1613	1460	1460
query60	310	268	249	249
query61	151	142	141	141
query62	700	652	576	576
query63	245	206	204	204
query64	2833	1068	854	854
query65	4789	4768	4742	4742
query66	1841	560	387	387
query67	29435	29466	29299	29299
query68	3166	1672	1022	1022
query69	419	293	266	266
query70	1041	933	919	919
query71	351	309	310	309
query72	3054	2688	2393	2393
query73	871	810	443	443
query74	5118	4973	4793	4793
query75	2628	2610	2214	2214
query76	2328	1176	766	766
query77	358	380	278	278
query78	12321	12359	11791	11791
query79	1502	1129	759	759
query80	1292	540	448	448
query81	525	312	281	281
query82	762	156	122	122
query83	361	307	287	287
query84	322	157	130	130
query85	998	612	528	528
query86	454	294	271	271
query87	1831	1823	1755	1755
query88	3679	2755	2827	2755
query89	462	405	352	352
query90	1925	205	191	191
query91	197	193	161	161
query92	67	60	54	54
query93	1824	1535	932	932
query94	764	362	330	330
query95	819	571	443	443
query96	1078	784	345	345
query97	2708	2704	2570	2570
query98	215	203	202	202
query99	1147	1170	1044	1044
Total cold run time: 266691 ms
Total hot run time: 179913 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 24.96 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 52eea1e2c185ac182e1661a7a9197002b5d4085a, data reload: false

query1	0.00	0.01	0.00
query2	0.10	0.05	0.05
query3	0.30	0.14	0.13
query4	1.61	0.15	0.13
query5	0.24	0.24	0.23
query6	1.24	1.02	1.02
query7	0.04	0.01	0.00
query8	0.05	0.04	0.04
query9	0.41	0.31	0.31
query10	0.55	0.56	0.59
query11	0.20	0.13	0.14
query12	0.18	0.14	0.14
query13	0.47	0.48	0.47
query14	1.01	1.01	0.99
query15	0.60	0.60	0.59
query16	0.31	0.32	0.31
query17	1.10	1.08	1.09
query18	0.22	0.21	0.21
query19	2.08	1.95	1.98
query20	0.01	0.01	0.01
query21	15.51	0.22	0.14
query22	4.86	0.05	0.05
query23	16.13	0.31	0.12
query24	2.98	0.42	0.35
query25	0.12	0.06	0.04
query26	0.78	0.21	0.14
query27	0.05	0.04	0.04
query28	3.50	0.89	0.55
query29	12.50	4.07	3.20
query30	0.27	0.15	0.14
query31	2.77	0.60	0.31
query32	3.25	0.60	0.49
query33	3.10	3.26	3.17
query34	15.72	4.26	3.53
query35	3.53	3.55	3.56
query36	0.55	0.43	0.43
query37	0.09	0.06	0.07
query38	0.05	0.04	0.03
query39	0.04	0.03	0.03
query40	0.19	0.16	0.15
query41	0.10	0.03	0.02
query42	0.04	0.03	0.04
query43	0.04	0.04	0.04
Total cold run time: 96.89 s
Total hot run time: 24.96 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 59.46% (66/111) 🎉
Increment coverage report
Complete coverage report

@shuke987

shuke987 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17882	4172	4096	4096
q2	2048	330	211	211
q3	10250	1412	825	825
q4	4685	473	343	343
q5	7541	864	576	576
q6	177	169	136	136
q7	810	870	644	644
q8	9414	1611	1595	1595
q9	5722	4463	4456	4456
q10	6643	1821	1517	1517
q11	526	352	312	312
q12	702	543	432	432
q13	18067	3414	2800	2800
q14	267	265	238	238
q15	q16	792	789	710	710
q17	1009	1055	863	863
q18	6714	5699	5577	5577
q19	1144	1188	1045	1045
q20	724	643	559	559
q21	5629	2568	2400	2400
q22	428	361	305	305
Total cold run time: 101174 ms
Total hot run time: 29640 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4396	4326	4316	4316
q2	291	320	215	215
q3	4570	4953	4450	4450
q4	2037	2163	1357	1357
q5	4462	4408	4388	4388
q6	225	169	127	127
q7	1719	1930	1795	1795
q8	2563	2246	2224	2224
q9	8224	8153	7767	7767
q10	4728	4675	4233	4233
q11	553	440	427	427
q12	743	784	556	556
q13	3154	3733	3027	3027
q14	305	301	279	279
q15	q16	720	742	669	669
q17	1363	1315	1310	1310
q18	7901	7318	7348	7318
q19	1207	1127	1100	1100
q20	2205	2201	1955	1955
q21	5241	4547	4455	4455
q22	517	473	406	406
Total cold run time: 57124 ms
Total hot run time: 52374 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 180398 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 0ba4a08a802ef38f0d204ef8e70142471428b59e, data reload: false

query5	4322	632	500	500
query6	472	223	252	223
query7	4866	570	357	357
query8	342	189	173	173
query9	8766	4033	4004	4004
query10	497	381	324	324
query11	5947	2346	2159	2159
query12	163	103	100	100
query13	1268	609	449	449
query14	6292	5330	4971	4971
query14_1	4323	4279	4281	4279
query15	216	207	187	187
query16	1019	448	474	448
query17	932	704	567	567
query18	2444	458	339	339
query19	201	181	143	143
query20	104	107	111	107
query21	234	156	129	129
query22	13695	13600	13538	13538
query23	17437	16561	16211	16211
query23_1	16190	16220	16291	16220
query24	7566	1749	1284	1284
query24_1	1312	1303	1294	1294
query25	562	445	361	361
query26	1333	374	205	205
query27	2608	587	377	377
query28	4497	2010	2029	2010
query29	1065	607	484	484
query30	340	257	219	219
query31	1111	1085	973	973
query32	106	60	57	57
query33	532	320	248	248
query34	1186	1163	659	659
query35	767	770	669	669
query36	1388	1393	1215	1215
query37	163	113	94	94
query38	1864	1703	1642	1642
query39	932	930	884	884
query39_1	887	910	899	899
query40	241	167	147	147
query41	73	71	71	71
query42	94	123	88	88
query43	319	322	281	281
query44	1427	783	769	769
query45	203	189	174	174
query46	1076	1207	752	752
query47	2337	2330	2217	2217
query48	409	402	299	299
query49	562	415	326	326
query50	1053	413	324	324
query51	10552	10833	10700	10700
query52	86	85	75	75
query53	268	296	194	194
query54	274	221	219	219
query55	72	69	66	66
query56	282	306	302	302
query57	1425	1401	1326	1326
query58	269	256	250	250
query59	1590	1686	1486	1486
query60	305	270	260	260
query61	155	148	147	147
query62	695	642	596	596
query63	256	206	208	206
query64	2826	1013	846	846
query65	4877	4794	4760	4760
query66	1861	519	413	413
query67	29585	29430	29319	29319
query68	3235	1532	963	963
query69	428	314	286	286
query70	1092	1002	907	907
query71	366	322	316	316
query72	3249	2891	2515	2515
query73	840	815	439	439
query74	5167	4987	4767	4767
query75	2621	2585	2226	2226
query76	2350	1172	809	809
query77	351	382	282	282
query78	12435	12326	11708	11708
query79	1473	1185	781	781
query80	1297	548	478	478
query81	522	327	283	283
query82	662	157	127	127
query83	383	320	292	292
query84	330	162	134	134
query85	969	593	532	532
query86	429	314	292	292
query87	1833	1820	1767	1767
query88	3730	2802	2809	2802
query89	453	394	359	359
query90	1943	199	200	199
query91	240	187	154	154
query92	61	62	56	56
query93	1693	1560	1019	1019
query94	731	362	321	321
query95	779	591	461	461
query96	1028	782	360	360
query97	2709	2703	2549	2549
query98	218	205	203	203
query99	1142	1168	1020	1020
Total cold run time: 266343 ms
Total hot run time: 180398 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 25 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 0ba4a08a802ef38f0d204ef8e70142471428b59e, data reload: false

query1	0.01	0.00	0.01
query2	0.10	0.05	0.04
query3	0.27	0.15	0.14
query4	1.60	0.14	0.13
query5	0.26	0.24	0.23
query6	1.24	1.08	1.10
query7	0.05	0.01	0.01
query8	0.06	0.03	0.04
query9	0.38	0.31	0.31
query10	0.56	0.56	0.61
query11	0.19	0.13	0.14
query12	0.19	0.15	0.14
query13	0.46	0.48	0.47
query14	1.03	1.03	1.04
query15	0.63	0.59	0.59
query16	0.32	0.34	0.32
query17	1.09	1.11	1.08
query18	0.23	0.21	0.21
query19	2.01	1.97	1.92
query20	0.01	0.01	0.01
query21	15.45	0.20	0.14
query22	4.93	0.05	0.05
query23	16.22	0.31	0.11
query24	2.92	0.41	0.34
query25	0.10	0.05	0.04
query26	0.73	0.20	0.16
query27	0.04	0.04	0.04
query28	3.50	0.90	0.54
query29	12.49	4.10	3.21
query30	0.28	0.15	0.15
query31	2.77	0.60	0.31
query32	3.23	0.60	0.50
query33	3.25	3.26	3.14
query34	15.45	4.22	3.51
query35	3.49	3.53	3.55
query36	0.56	0.43	0.42
query37	0.09	0.07	0.07
query38	0.05	0.04	0.04
query39	0.05	0.03	0.03
query40	0.17	0.16	0.15
query41	0.09	0.03	0.02
query42	0.03	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 96.62 s
Total hot run time: 25 s

@shuke987 shuke987 force-pushed the diagnose-profile-report-merge branch from 0ba4a08 to 9b6c1d0 Compare July 9, 2026 07:57
@shuke987 shuke987 changed the title [WIP][diagnose](profile) log query profile merge failures [fix](profile) guard execution profile access Jul 9, 2026
@shuke987

shuke987 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

run buildall

@shuke987

shuke987 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@shuke987 shuke987 requested a review from morningman July 9, 2026 08:00

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I did not find any new blocking issue in the current head.

Critical checkpoint conclusions:

  • Goal: the PR guards ProfileManager.getExecutionProfile() with the existing profile-manager read lock and isolates dml_profile_safe from concurrent profile suites. The current diff accomplishes both stated goals.
  • Scope: the patch is small and focused: one FE lock correction and one regression-suite scheduling tag.
  • Concurrency/lifecycle: all direct queryIdToExecutionProfiles mutations in ProfileManager are under the write lock, and the new accessor now uses the read lock. The returned ExecutionProfile reference is still used outside the manager lock, which matches the existing async profile-update design; the mutable per-fragment profile maps have their own ExecutionProfile lock.
  • Locking cost/order: the new lock protects only a map lookup, with no RPC, external IO, journal wait, or nested catalog/table lock while held.
  • Config/session compatibility: no new config was added. Existing profile session variables are unchanged. The nonConcurrent tag is recognized by the regression framework as the single-run group, which is appropriate for a suite that executes clean all profile.
  • Incompatible formats/persistence: no Thrift, storage, or EditLog format changes are involved.
  • Parallel paths: BE final profile reports reach the map through QeProcessorImpl.processQueryProfile() -> ProfileManager.getExecutionProfile(), while finish marking and cleanup paths already use the same manager lock model. The previous WARN-level logging concerns in discussion_r3541179558 and discussion_r3543041140 were read as existing review context and are not duplicated; the current head no longer contains those WARN changes.
  • Tests/validation: PR-scoped git show --check -- fe/fe-core/src/main/java/org/apache/doris/common/profile/ProfileManager.java regression-test/suites/query_profile/dml_profile_safe.groovy was clean. Local FE build/regression was not run because this checkout is missing thirdparty/installed and thirdparty/installed/bin/protoc.

User focus: no additional user-provided review focus was supplied.

Subagent conclusions: the optimizer-rewrite subagent reviewed optimizer/rewrite and parallel plan concerns and appended no candidates. The tests-session-config subagent reviewed regression/session/config and basic CI/style concerns and appended no candidates. Convergence round 1 used the final ledger and proposed no-inline-comment set; both live subagents replied NO_NEW_VALUABLE_FINDINGS, and no unresolved candidate remains in the ledger.

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

@hello-stephen

Copy link
Copy Markdown
Contributor

skip buildall

@morningman morningman merged commit 2287a7e into apache:master Jul 9, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants