Skip to content

[refactor](nereids) Remove minidump, plan replayer, and tracing - #67811

Open
morrySnow wants to merge 2 commits into
apache:masterfrom
morrySnow:codex/remove-minidump-plan-replayer-nereids-trace
Open

[refactor](nereids) Remove minidump, plan replayer, and tracing#67811
morrySnow wants to merge 2 commits into
apache:masterfrom
morrySnow:codex/remove-minidump-plan-replayer-nereids-trace

Conversation

@morrySnow

@morrySnow morrySnow commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: None

Related PR: #66817

Problem Summary:

The remaining minidump dump path and Nereids trace framework are no longer needed after offline plan replay was removed. Remove PLAN REPLAYER DUMP and its REST endpoint, minidump serialization, replay-only statistics and context plumbing, the enable_nereids_trace variables, and the event tracing implementation. Also remove replay-specific privilege and row-policy bypasses so normal planning always uses catalog statistics and standard authorization paths.

Release note

Remove PLAN REPLAYER DUMP, the /api/minidump endpoint, and the enable_nereids_trace and nereids_trace_event_mode session variables.

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
      • ./run-fe-ut.sh --run org.apache.doris.nereids.parser.NereidsParserTest,org.apache.doris.nereids.rules.analysis.UserAuthenticationTest (94 tests)
    • Manual test
    • No need to test or manual test
  • Behavior changed:

    • No.
    • Yes. Remove the minidump, plan replayer dump, and Nereids trace interfaces.
  • Does this need documentation?

    • No. These developer-only interfaces are not documented.
    • Yes.

@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?

@morrySnow morrySnow changed the title [refactor](nereids) Remove minidump and Nereids tracing [refactor](nereids) Remove minidump, plan replayer, and tracing Sep 10, 2026
@morrySnow

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 26.67% (8/30) 🎉
Increment coverage report
Complete coverage report

924060929
924060929 previously approved these changes Sep 12, 2026

@924060929 924060929 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.

Reviewed at a5bb3aa. The removal is cohesive: parser/command and REST entry points, session/config state, replay-only authorization and statistics branches, and tracing hooks are removed consistently. I found no remaining references or behavioral changes outside the retired interfaces.

### What problem does this PR solve?

Issue Number: None

Related PR: apache#66817

Problem Summary: The remaining minidump dump path and Nereids trace framework are no longer needed after offline plan replay was removed. Remove PLAN REPLAYER DUMP and its REST endpoint, minidump serialization, replay-only statistics and context plumbing, the enable_nereids_trace variables, and the event tracing implementation. Also remove replay-specific privilege and row-policy bypasses so normal planning always uses catalog statistics and standard authorization paths.

### Release note

Remove `PLAN REPLAYER DUMP`, the `/api/minidump` endpoint, and the `enable_nereids_trace` and `nereids_trace_event_mode` session variables.

### Check List (For Author)

- Test: Unit Test
    - `NereidsParserTest`
    - `UserAuthenticationTest`
- Behavior changed: Yes. Remove the minidump, plan replayer dump, and Nereids trace interfaces.
- Does this need documentation: No. These developer-only interfaces are not documented.
@morrySnow
morrySnow force-pushed the codex/remove-minidump-plan-replayer-nereids-trace branch from a5bb3aa to 756d323 Compare September 14, 2026 03:55
@morrySnow

Copy link
Copy Markdown
Contributor Author

run buildall

@morrySnow

Copy link
Copy Markdown
Contributor Author

/review

@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.

Request changes: one compatibility regression remains; see the inline comment.

Static review at exact head 756d3234912486b7df6e73d37a16a66ee6998133:

  • Goal, scope, and tests: the command, REST action, minidump/tracer state, replay-only branches, configs, and tests are removed cohesively; parser coverage checks command rejection and identifier reuse, and the changes stay focused on that removal. The author reports NereidsParserTest and UserAuthenticationTest (94 tests); I did not run builds or tests because the review contract prohibits it. No regression result files change, and compatibility coverage for the retired variables is missing.
  • Control flow, lifecycle, concurrency, and performance: ordinary query/explain/HTTP-stream/error, rewrite/memo/cost/enforcer, and statistics paths retain their former non-replay behavior. Removing the global tracer queue, counters, retained plans, JSON, and file I/O reduces shared-state and hot-path overhead.
  • Compatibility, configuration, persistence, protocols, and data correctness: old FE config keys and persisted unknown fields are ignored. No FE-BE protocol, edit-log/storage format, transaction, data-write, or visibility invariant changes. The exception is the two removed public session variables, whose missing retired-name registrations break live SET/SET_VAR/SELECT @@ compatibility (inline).
  • Security: the replay-only policy and privilege bypasses disappear while normal RBAC and SQL-cache revalidation remain, strengthening the modeled boundary rather than introducing a new authorization issue.
  • Observability: minidump/tracing removal is intentional; ordinary plan-process, profile, debug-log, and memo-dump diagnostics remain.
  • User focus: none was supplied. At submission, CheckStyle, BE UT, Cloud UT, and coverage pass; COMPILE and FE UT are still pending.

Comment thread fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17569	3039	3003	3003
q2	2057	257	222	222
q3	10279	858	513	513
q4	4673	253	199	199
q5	7673	561	384	384
q6	136	114	95	95
q7	522	501	385	385
q8	9229	929	873	873
q9	3423	2402	2420	2402
q10	6511	880	731	731
q11	394	199	175	175
q12	640	260	200	200
q13	18096	1539	1163	1163
q14	166	147	140	140
q15	q16	442	399	378	378
q17	1373	850	776	776
q18	3183	2303	2315	2303
q19	1252	907	753	753
q20	377	283	211	211
q21	5598	1716	1817	1716
q22	332	272	230	230
Total cold run time: 93925 ms
Total hot run time: 16852 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3377	3306	3287	3287
q2	510	395	364	364
q3	2276	2389	2249	2249
q4	1213	1186	903	903
q5	2221	2153	2154	2153
q6	167	123	86	86
q7	1085	931	881	881
q8	1603	1413	1398	1398
q9	3220	3191	3193	3191
q10	1909	1851	1643	1643
q11	356	277	255	255
q12	459	428	335	335
q13	1473	1545	1155	1155
q14	171	165	173	165
q15	q16	398	394	354	354
q17	3742	3410	3282	3282
q18	4944	4513	4877	4513
q19	1022	862	862	862
q20	1019	957	824	824
q21	3851	3172	3183	3172
q22	395	338	329	329
Total cold run time: 35411 ms
Total hot run time: 31401 ms

@hello-stephen

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

query5	4258	414	343	343
query6	394	141	138	138
query7	4922	428	233	233
query8	286	126	115	115
query9	8691	2896	2863	2863
query10	407	222	185	185
query11	5390	1047	915	915
query12	118	72	71	71
query13	1208	449	320	320
query14	6013	2266	2131	2131
query14_1	2035	2020	2030	2020
query15	175	120	116	116
query16	921	385	359	359
query17	802	449	359	359
query18	2336	335	240	240
query19	164	142	106	106
query20	73	72	71	71
query21	203	102	87	87
query22	5540	5582	5454	5454
query23	6983	6402	6137	6137
query23_1	6126	6281	6127	6127
query24	7331	1114	757	757
query24_1	790	762	808	762
query25	444	300	262	262
query26	1226	236	135	135
query27	2783	429	257	257
query28	4656	1483	1489	1483
query29	923	446	351	351
query30	277	158	134	134
query31	830	400	339	339
query32	135	79	77	77
query33	475	222	189	189
query34	1056	828	494	494
query35	416	395	349	349
query36	577	559	537	537
query37	120	81	70	70
query38	1019	869	821	821
query39	501	489	488	488
query39_1	457	465	468	465
query40	207	94	80	80
query41	58	60	57	57
query42	74	74	75	74
query43	242	245	218	218
query44	983	534	518	518
query45	115	110	99	99
query46	761	848	531	531
query47	765	771	730	730
query48	325	309	236	236
query49	543	232	193	193
query50	757	250	200	200
query51	8104	8035	8140	8035
query52	69	65	64	64
query53	217	201	152	152
query54	210	164	157	157
query55	104	59	55	55
query56	195	156	173	156
query57	716	690	679	679
query58	182	165	176	165
query59	1242	1268	1141	1141
query60	270	190	171	171
query61	117	113	119	113
query62	348	206	175	175
query63	172	138	143	138
query64	2788	674	611	611
query65	1745	1652	1601	1601
query66	1784	246	206	206
query67	9951	9737	9882	9737
query68	3028	1160	740	740
query69	346	216	202	202
query70	655	629	621	621
query71	250	179	168	168
query72	2284	1690	1521	1521
query73	659	583	358	358
query74	2003	1254	1159	1159
query75	1190	1111	972	972
query76	2360	714	505	505
query77	258	268	218	218
query78	3911	3746	3310	3310
query79	2742	842	559	559
query80	1586	323	272	272
query81	505	156	136	136
query82	627	118	97	97
query83	272	212	193	193
query84	298	113	90	90
query85	826	338	283	283
query86	394	179	170	170
query87	1035	977	906	906
query88	2816	2110	2105	2105
query89	281	198	177	177
query90	1967	134	134	134
query91	129	117	97	97
query92	78	73	64	64
query93	1919	1114	667	667
query94	647	280	209	209
query95	520	342	235	235
query96	789	602	279	279
query97	1066	1082	1029	1029
query98	175	140	131	131
query99	425	347	310	310
Total cold run time: 179557 ms
Total hot run time: 82747 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.07	0.04	0.04
query3	0.25	0.11	0.11
query4	1.61	0.10	0.10
query5	0.18	0.15	0.16
query6	1.27	0.69	0.68
query7	0.03	0.00	0.01
query8	0.04	0.03	0.03
query9	0.28	0.21	0.22
query10	0.34	0.34	0.35
query11	0.16	0.12	0.11
query12	0.15	0.12	0.12
query13	0.30	0.31	0.31
query14	0.48	0.46	0.47
query15	0.37	0.37	0.35
query16	0.23	0.23	0.23
query17	0.66	0.74	0.68
query18	0.16	0.14	0.16
query19	1.21	1.20	1.18
query20	0.02	0.01	0.01
query21	15.46	0.15	0.11
query22	5.09	0.04	0.05
query23	16.18	0.25	0.10
query24	2.99	0.33	0.26
query25	0.11	0.03	0.04
query26	0.82	0.16	0.13
query27	0.04	0.03	0.04
query28	3.69	0.52	0.28
query29	12.47	3.14	2.56
query30	0.26	0.11	0.12
query31	2.75	0.38	0.17
query32	3.51	0.34	0.23
query33	1.41	1.51	1.54
query34	15.36	2.18	1.82
query35	1.76	1.75	1.74
query36	0.45	0.29	0.29
query37	0.06	0.03	0.04
query38	0.05	0.03	0.03
query39	0.04	0.02	0.02
query40	0.11	0.09	0.08
query41	0.08	0.03	0.02
query42	0.03	0.02	0.02
query43	0.04	0.03	0.02
Total cold run time: 90.58 s
Total hot run time: 14.88 s

### What problem does this PR solve?

Issue Number: N/A

Related PR: apache#67811

Problem Summary: Removing the Nereids trace @VarAttr registrations made upgraded FEs treat legacy SET and SELECT @@ traffic as unknown system variables. Preserve both retired names in the removed-session-variable compatibility set and cover primary and forwarded SET plus old-planner and Nereids reads.

### Release note

Preserve no-op compatibility for the removed enable_nereids_trace and nereids_trace_event_mode session variables.

### Check List (For Author)

- Test: Unit Test
  - ./run-fe-ut.sh --run org.apache.doris.qe.VariableMgrTest
- Behavior changed: Yes, legacy accesses to the removed trace variables remain compatible no-ops.
- Does this need documentation: No
@morrySnow

Copy link
Copy Markdown
Contributor Author

run buildall

@morrySnow

Copy link
Copy Markdown
Contributor Author

/review

@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.

Request changes: one binary-artifact closure issue remains; see the inline comment.

Static review at exact head ef2cd1599fcd137491b90e22a7de662051e5f9aa:

  • Goal, scope, and tests: the source-level removal of the command, REST action, minidump/tracing state, replay-only branches, configs, and fixtures is cohesive. Parser tests cover command rejection and REPLAYER identifier reuse; compatibility tests cover the two retired session-variable names. The author reports the focused parser, authorization, and variable tests; I did not run builds or tests because the review contract prohibits it.
  • Control flow and data correctness: ordinary analyze/rewrite/memo/statistics/cost/enforcer/translation behavior remains the former non-replay path. The flattened statistics logic is equivalent for normal queries, and no FE-BE protocol, edit-log/storage format, transaction, data-write, or visibility invariant changes.
  • Lifecycle, concurrency, and performance: removing the global tracer state, daemon queue, retained plans, event counters, JSON generation, and dump I/O removes shared mutable state and hot-path diagnostic work. No new lock, allocation, or failure-path concern remains.
  • Compatibility and configuration: old FE config keys and serialized unknown session fields are ignored safely. The exact-head fix preserves case-insensitive direct/forwarded SET, SET_VAR, legacy read, and Nereids read compatibility for both retired trace variables; that earlier discussion is duplicate-fenced. The remaining issue is binary build-output compatibility on the standard non-clean FE packaging path (inline).
  • Security: removal of replay-only policy and privilege bypasses leaves ordinary RBAC behavior unchanged and strengthens surviving planner entry points. No new modeled authorization boundary issue was found.
  • Observability: loss of minidump/tracing is intentional; normal plan-process traces, profiles, debug logs, and memo dumps remain.
  • User focus: none was supplied. At submission, CheckStyle, BE UT, Cloud UT, and coverage pass; FE UT is red in two untouched HDFS/Iceberg tests, while compile, performance, and review checks remain pending.

// Usage:
// wget http://fe_host:fe_http_port/api/minidump?query_id=123456
@RestController
public class MinidumpAction extends RestBaseController {

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.

[P2] Clean deleted FE classes before incremental packaging

./build.sh --fe defaults to a non-clean Maven package, so on a cache-miss build after checking out this head over a base-built tree, javac leaves this deleted controller and MinidumpUtils under fe/fe-core/target/classes, and the jar plugin packages them again. Spring then still registers /api/minidump; invoking it initializes the stale utility against the new Config and throws NoSuchFieldError for spilled_minidump_storage_path. Please make the standard FE packaging path remove the deleted class outputs or otherwise force a clean for this transition, and verify the resulting jar no longer contains them.

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17570	3034	3015	3015
q2	2054	255	222	222
q3	10277	896	516	516
q4	4674	253	203	203
q5	7666	571	389	389
q6	132	113	95	95
q7	525	500	386	386
q8	9234	846	852	846
q9	3575	2420	2419	2419
q10	6511	864	725	725
q11	400	200	184	184
q12	611	260	199	199
q13	18142	1553	1182	1182
q14	159	153	139	139
q15	q16	448	396	375	375
q17	1399	897	801	801
q18	3125	2304	2280	2280
q19	1274	849	791	791
q20	372	283	196	196
q21	5579	1808	1885	1808
q22	326	266	242	242
Total cold run time: 94053 ms
Total hot run time: 17013 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3387	3339	3299	3299
q2	506	385	367	367
q3	2283	2312	2200	2200
q4	1216	1196	894	894
q5	2259	2155	2146	2146
q6	171	121	87	87
q7	1021	938	848	848
q8	1580	1377	1400	1377
q9	3193	3201	3171	3171
q10	1911	1823	1657	1657
q11	370	275	256	256
q12	455	435	339	339
q13	1489	1539	1195	1195
q14	181	168	164	164
q15	q16	395	405	364	364
q17	3730	3381	3404	3381
q18	4897	4512	4969	4512
q19	955	854	857	854
q20	1004	990	857	857
q21	3838	3183	3178	3178
q22	401	341	323	323
Total cold run time: 35242 ms
Total hot run time: 31469 ms

@hello-stephen

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

query5	4240	415	328	328
query6	394	159	125	125
query7	4931	417	223	223
query8	284	126	115	115
query9	8676	2895	2871	2871
query10	398	226	181	181
query11	5397	1080	925	925
query12	117	70	68	68
query13	1192	476	314	314
query14	6054	2247	2157	2157
query14_1	2042	1998	2003	1998
query15	174	138	119	119
query16	907	376	279	279
query17	807	463	344	344
query18	2314	309	216	216
query19	161	133	102	102
query20	71	67	70	67
query21	206	100	88	88
query22	5570	5455	5382	5382
query23	6880	6503	6109	6109
query23_1	6103	6109	6299	6109
query24	7259	1124	778	778
query24_1	751	797	779	779
query25	394	289	222	222
query26	1222	224	126	126
query27	2804	409	243	243
query28	4702	1501	1475	1475
query29	903	410	326	326
query30	251	154	124	124
query31	825	399	328	328
query32	126	71	76	71
query33	452	214	175	175
query34	1002	810	461	461
query35	407	391	345	345
query36	564	567	537	537
query37	117	85	69	69
query38	1010	857	828	828
query39	509	460	463	460
query39_1	454	449	457	449
query40	197	88	80	80
query41	59	56	58	56
query42	83	77	74	74
query43	244	245	217	217
query44	1023	534	538	534
query45	116	110	108	108
query46	781	849	514	514
query47	760	780	708	708
query48	321	307	231	231
query49	544	259	203	203
query50	745	274	200	200
query51	8093	8070	8045	8045
query52	67	70	61	61
query53	187	197	154	154
query54	202	171	158	158
query55	72	63	61	61
query56	192	281	175	175
query57	703	681	694	681
query58	196	177	155	155
query59	1247	1256	1123	1123
query60	262	184	178	178
query61	118	121	128	121
query62	347	209	187	187
query63	178	139	143	139
query64	2854	724	619	619
query65	1641	1663	1625	1625
query66	1811	281	197	197
query67	10013	9871	10030	9871
query68	2742	1246	761	761
query69	358	228	203	203
query70	677	608	612	608
query71	257	165	169	165
query72	2401	1673	1560	1560
query73	640	557	331	331
query74	1565	1257	1169	1169
query75	1169	1122	979	979
query76	2292	722	514	514
query77	252	258	209	209
query78	3936	3706	3324	3324
query79	1204	768	574	574
query80	707	320	276	276
query81	454	159	137	137
query82	590	130	97	97
query83	315	208	191	191
query84	292	104	88	88
query85	777	332	277	277
query86	351	178	162	162
query87	1034	979	915	915
query88	2734	2087	2079	2079
query89	279	190	176	176
query90	1833	131	121	121
query91	132	118	97	97
query92	81	69	69	69
query93	1181	1076	655	655
query94	496	262	210	210
query95	537	321	217	217
query96	797	557	272	272
query97	1064	1100	1025	1025
query98	147	136	137	136
query99	415	353	312	312
Total cold run time: 174815 ms
Total hot run time: 82506 ms

@hello-stephen

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

query1	0.00	0.00	0.01
query2	0.07	0.05	0.04
query3	0.24	0.11	0.10
query4	1.61	0.11	0.10
query5	0.18	0.16	0.16
query6	1.26	0.73	0.67
query7	0.04	0.01	0.00
query8	0.04	0.03	0.03
query9	0.29	0.21	0.22
query10	0.34	0.34	0.35
query11	0.16	0.12	0.12
query12	0.14	0.13	0.13
query13	0.31	0.31	0.31
query14	0.46	0.46	0.45
query15	0.37	0.36	0.35
query16	0.21	0.22	0.25
query17	0.68	0.70	0.71
query18	0.18	0.16	0.17
query19	1.12	1.16	1.11
query20	0.02	0.03	0.01
query21	15.47	0.18	0.12
query22	5.09	0.04	0.05
query23	16.18	0.25	0.11
query24	2.99	0.33	0.28
query25	0.10	0.04	0.03
query26	0.84	0.16	0.12
query27	0.03	0.04	0.03
query28	3.70	0.57	0.26
query29	12.45	3.18	2.54
query30	0.25	0.12	0.12
query31	2.76	0.38	0.17
query32	3.57	0.32	0.23
query33	1.49	1.44	1.44
query34	15.37	2.21	1.78
query35	1.76	1.75	1.74
query36	0.46	0.30	0.28
query37	0.06	0.04	0.04
query38	0.04	0.03	0.03
query39	0.03	0.02	0.03
query40	0.13	0.07	0.08
query41	0.08	0.02	0.03
query42	0.04	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 90.64 s
Total hot run time: 14.73 s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants