Skip to content

[refactor](coordinator) Unify query execution in Coordinator - #69830

Merged
924060929 merged 11 commits into
apache:masterfrom
924060929:codex/remove-legacy-coordinator
Nov 4, 2026
Merged

924060929 merged 11 commits into
apache:masterfrom
924060929:codex/remove-legacy-coordinator

Conversation

@924060929

@924060929 924060929 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Problem Summary:

FE still carries two execution coordinators: the legacy Coordinator assigns scan ranges and fragment instances itself, while NereidsCoordinator executes Nereids distributed plans but inherits the legacy coordinator's state and initialization. CloudCoordinator adds another legacy-only factory branch. This duplicates scheduling and lifecycle ownership and retains a fallback that newer execution features do not support.

Replace the legacy implementation with the standalone Nereids implementation, renamed to Coordinator, and remove NereidsCoordinator and CloudCoordinator. SQL, INSERT and background load creation now use the same factory. Cloud compute-group selection, privilege validation and backend membership remain in BackendDistributedPlanWorkerManager during distributed planning.

Preserve the remaining shared capabilities explicitly: HTTP Stream Load generates parameters with ThriftPlansBuilder and retains one fragment instance on the receiving BE, matching its single completion callback; Arrow Flight retains scans that must outlive dispatch; streaming INSERT retains scan backend IDs; cancellation uses the runtime task state, without treating remote-catalog workers as local backends. Group-commit backend selection remains in distributed planning.

Keep set-operation bucket-shuffle scheduling markers aligned with the selected child distribution, including when local shuffle is disabled, so pruned scans retain all required bucket receivers.

Preserve backend-restart cancellation when a fragment captured an uninitialized epoch (-1 or 0), while retaining the current-zero replay/upgrade exception. Stabilize the nested full-outer-join EXPLAIN with a statement-scoped bucket-shuffle downgrade setting, keeping the outer-join elimination checks independent of actual backend count and pipeline parallelism.

Migrate join-distribution assertions to effective statement-scoped settings: cover both partitioned and bucket-shuffle plans, retain exchange-count checks, and make pruning checks exercise the bucket path without an early skip. Keep the removed setting where it still provides compatibility coverage; do not mechanically rewrite unrelated test expectations.

Retire enable_nereids_distribute_planner using the existing removed-variable handling and remove its legacy-only optimizer branches. Migrate unit fixtures to the distributed planner's query identity, worker and local-exchange contracts. Regenerate EXPLAIN-shape expectations with the Nereids distribution/property path while preserving query-result checks.

Release note

Use Nereids distributed planning for all queries and loads. enable_nereids_distribute_planner no longer selects a planner; existing SET statements for this removed variable remain accepted.

Check List (For Author)

  • Test: FE build and Checkstyle; focused FE unit coverage for coordinator lifecycle, runtime health, cloud selection, Flight, stream-load planning and distribution. Audited all 1,225 files with disabled-planner settings; all 1,204 associated shape scripts compared with real FE planning and original injected statistics using mock backends. The outer-join assertions covered both distributions with 1/3 backends and parallelism 1/7; fragment/exchange probes covered parallelism 1/7/16. Golden output is unchanged by this test migration. Full BE-backed query-result regression and OBS/COS plugin packaging were not run locally.
  • Behavior changed: Yes. Remove the legacy scheduling fallback and always use Nereids distributed planning.
  • Does this need documentation: No; the retired variable is hidden by the existing removed-variable mechanism.

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

@924060929

Copy link
Copy Markdown
Contributor Author

run buildall

@924060929

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Selected model is at capacity. Please try a different model.
Workflow run: https://github.com/apache/doris/actions/runs/40840547674

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17589	5115	5049	5049
q2	2121	317	263	263
q3	10234	1439	814	814
q4	4681	462	334	334
q5	7445	794	542	542
q6	179	180	152	152
q7	783	789	602	602
q8	9239	1342	1141	1141
q9	5472	4201	4185	4185
q10	6816	1293	1011	1011
q11	434	255	242	242
q12	642	397	278	278
q13	18130	3646	3064	3064
q14	267	272	249	249
q15	q16	744	727	665	665
q17	1212	763	574	574
q18	7022	6179	6109	6109
q19	1105	960	592	592
q20	390	344	225	225
q21	5921	2542	2455	2455
q22	376	336	274	274
Total cold run time: 100802 ms
Total hot run time: 28820 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5935	5927	6070	5927
q2	739	664	603	603
q3	5578	5857	5321	5321
q4	2035	2134	1583	1583
q5	5796	5833	5659	5659
q6	241	191	140	140
q7	2236	2045	1806	1806
q8	3019	2636	2666	2636
q9	7957	7482	7513	7482
q10	3638	3585	3185	3185
q11	591	417	384	384
q12	659	686	496	496
q13	3267	3646	3109	3109
q14	286	289	267	267
q15	q16	671	698	608	608
q17	7756	7058	6857	6857
q18	12940	12149	12815	12149
q19	908	789	769	769
q20	2152	2155	1898	1898
q21	5691	4588	4797	4588
q22	503	437	422	422
Total cold run time: 72598 ms
Total hot run time: 65889 ms

@hello-stephen

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

query5	4312	580	440	440
query6	418	202	197	197
query7	4809	447	233	233
query8	311	161	161	161
query9	8781	3213	3207	3207
query10	475	302	265	265
query11	5960	3896	3579	3579
query12	149	93	87	87
query13	1279	438	310	310
query14	6126	3959	3676	3676
query14_1	3441	3392	3461	3392
query15	204	193	194	193
query16	956	398	470	398
query17	875	627	515	515
query18	2420	419	301	301
query19	205	162	134	134
query20	85	80	89	80
query21	219	128	103	103
query22	12966	13057	12790	12790
query23	13567	12897	12403	12403
query23_1	12445	12624	12455	12455
query24	7360	843	462	462
query24_1	479	476	481	476
query25	517	396	339	339
query26	1258	248	137	137
query27	2807	438	272	272
query28	4623	2022	2050	2022
query29	1568	590	440	440
query30	302	219	185	185
query31	1002	926	824	824
query32	159	99	91	91
query33	527	302	242	242
query34	889	902	510	510
query35	747	740	641	641
query36	828	801	717	717
query37	129	97	86	86
query38	1783	1738	1655	1655
query39	792	793	742	742
query39_1	719	732	734	732
query40	217	116	95	95
query41	66	63	68	63
query42	86	83	85	83
query43	343	362	309	309
query44	1333	725	728	725
query45	174	176	167	167
query46	836	977	563	563
query47	2879	2926	2566	2566
query48	300	331	227	227
query49	594	398	283	283
query50	677	277	218	218
query51	10540	10535	10425	10425
query52	82	85	70	70
query53	194	206	151	151
query54	244	190	177	177
query55	76	75	65	65
query56	233	214	207	207
query57	1647	1639	1563	1563
query58	293	265	252	252
query59	2148	2231	1999	1999
query60	296	244	225	225
query61	152	151	148	148
query62	383	336	282	282
query63	189	159	157	157
query64	2783	1055	893	893
query65	3319	3276	3284	3276
query66	1790	449	324	324
query67	20166	20303	19848	19848
query68	3183	1015	625	625
query69	401	290	269	269
query70	848	817	791	791
query71	305	243	214	214
query72	2890	2790	2475	2475
query73	515	569	298	298
query74	4630	4521	4350	4350
query75	2350	2289	1911	1911
query76	2323	1021	590	590
query77	341	378	273	273
query78	9744	9752	9068	9068
query79	1037	854	533	533
query80	1233	452	335	335
query81	604	312	268	268
query82	866	130	110	110
query83	308	203	178	178
query84	310	125	104	104
query85	863	443	377	377
query86	406	237	232	232
query87	2001	1964	1798	1798
query88	3845	2793	2773	2773
query89	336	285	245	245
query90	1915	165	170	165
query91	161	156	138	138
query92	103	88	82	82
query93	1053	1005	621	621
query94	658	304	279	279
query95	578	390	310	310
query96	694	487	241	241
query97	2419	2437	2315	2315
query98	166	162	148	148
query99	774	787	649	649
Total cold run time: 236165 ms
Total hot run time: 150950 ms

@924060929

Copy link
Copy Markdown
Contributor Author

run buildall

@924060929

Copy link
Copy Markdown
Contributor Author

/review

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.10	0.05	0.05
query3	0.27	0.08	0.08
query4	1.61	0.09	0.10
query5	0.26	0.24	0.23
query6	1.17	0.69	0.67
query7	0.04	0.00	0.00
query8	0.06	0.04	0.04
query9	0.40	0.34	0.34
query10	0.57	0.56	0.57
query11	0.20	0.15	0.15
query12	0.18	0.14	0.14
query13	0.48	0.51	0.49
query14	1.01	1.00	1.04
query15	0.62	0.60	0.60
query16	0.31	0.35	0.35
query17	1.12	1.12	1.12
query18	0.21	0.21	0.19
query19	2.08	1.97	1.98
query20	0.02	0.01	0.01
query21	15.49	0.20	0.13
query22	4.93	0.05	0.05
query23	16.26	0.32	0.12
query24	3.21	0.55	0.48
query25	0.10	0.06	0.06
query26	1.08	0.21	0.15
query27	0.05	0.03	0.05
query28	3.28	0.76	0.38
query29	12.51	4.26	3.36
query30	0.29	0.13	0.10
query31	2.77	0.56	0.32
query32	3.21	0.60	0.50
query33	3.08	3.21	3.25
query34	15.38	3.95	3.38
query35	3.34	3.31	3.32
query36	0.56	0.46	0.42
query37	0.09	0.06	0.07
query38	0.05	0.04	0.04
query39	0.03	0.04	0.04
query40	0.17	0.15	0.15
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.76 s
Total hot run time: 24.46 s

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

Static review of PR #69830 at head e9837f9 converged after round 1 with no verified blocking findings and no inline comments to publish.

Reviewed checkpoints: the EnvFactory planner cast and shared coordinator/load context wiring have repository callers that construct Nereids planners and establish the required load context; cloud coordinator removal preserves compute-group authorization, empty-group rejection, and backend selection; coordinator queue, cancellation, report, join, and cleanup paths retain terminal status and release resources across the examined orderings; unconditional Nereids distribution and the property/regulator changes cover the affected join, set-operation, recursive-CTE, and remote-Doris paths without a concrete changed-line mismatch; FILE_STREAM handling remains limited to the HTTP stream TVF path with one scan location and one instance, while group commit uses its separate scan node; and cache/adaptive FE RPCs retain coordinator null/lifetime guards and use the same planned instance data used for dispatch. The removed legacy fixtures and REMOVED session variable were checked as coverage/compatibility concerns, but no specific production failure was demonstrated. A late logical SQL-cache concern was rechecked and dismissed because the cache branch returns before the planner callback invokes distribution.

No user-provided review focus was supplied. No existing inline P0/P1 finding remains applicable, so existing_blocking_comment_ids is empty. This was a static-only review: no builds or tests were run, and inspected tests are cited only as source evidence. Convergence is true after round 1; all risk items and candidate findings are explicitly dismissed with evidence in the review ledger.

Review converged after 1 round(s).

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 60.58% (166/274) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17570	5140	5005	5005
q2	2103	318	260	260
q3	10233	1377	832	832
q4	4683	453	333	333
q5	7435	799	550	550
q6	182	183	151	151
q7	739	789	593	593
q8	9255	1336	1026	1026
q9	5482	4179	4191	4179
q10	6824	1284	1006	1006
q11	417	238	227	227
q12	634	395	273	273
q13	18075	3548	3036	3036
q14	270	270	249	249
q15	q16	713	716	658	658
q17	1181	748	568	568
q18	6988	6157	6072	6072
q19	1111	965	617	617
q20	404	330	229	229
q21	4970	2557	2482	2482
q22	370	319	273	273
Total cold run time: 99639 ms
Total hot run time: 28619 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	6030	5915	5949	5915
q2	717	580	562	562
q3	5502	5686	5267	5267
q4	1974	2120	1666	1666
q5	5942	5681	5689	5681
q6	242	195	141	141
q7	2221	1986	1753	1753
q8	2880	2429	2461	2429
q9	7537	7448	7423	7423
q10	3615	3557	3146	3146
q11	584	417	368	368
q12	660	682	495	495
q13	3273	3577	3053	3053
q14	290	280	253	253
q15	q16	657	695	626	626
q17	7676	6968	6832	6832
q18	12958	12167	12917	12167
q19	922	835	831	831
q20	2140	2111	1959	1959
q21	5539	4528	4687	4528
q22	505	445	403	403
Total cold run time: 71864 ms
Total hot run time: 65498 ms

@hello-stephen

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

query5	4318	599	453	453
query6	415	199	190	190
query7	4795	441	231	231
query8	327	166	161	161
query9	8809	3202	3249	3202
query10	456	308	241	241
query11	5916	3845	3601	3601
query12	138	89	84	84
query13	1232	439	331	331
query14	6091	3908	3625	3625
query14_1	3368	3385	3361	3361
query15	203	195	181	181
query16	940	439	422	422
query17	854	663	528	528
query18	2420	429	311	311
query19	195	165	138	138
query20	85	88	83	83
query21	208	130	104	104
query22	12965	12900	12748	12748
query23	13394	12758	12474	12474
query23_1	12451	12497	12526	12497
query24	7339	841	485	485
query24_1	488	495	489	489
query25	537	423	391	391
query26	1250	253	142	142
query27	2766	442	266	266
query28	4988	2034	2029	2029
query29	1578	587	438	438
query30	305	223	182	182
query31	991	928	820	820
query32	140	90	86	86
query33	523	294	226	226
query34	877	839	513	513
query35	735	749	650	650
query36	807	821	737	737
query37	120	103	81	81
query38	1777	1720	1656	1656
query39	788	790	742	742
query39_1	729	737	743	737
query40	212	113	95	95
query41	65	63	60	60
query42	87	81	88	81
query43	342	355	303	303
query44	1325	711	702	702
query45	174	175	169	169
query46	844	958	571	571
query47	2875	2609	2764	2609
query48	305	309	220	220
query49	573	398	292	292
query50	673	273	220	220
query51	10435	10476	10147	10147
query52	76	86	69	69
query53	184	211	151	151
query54	241	206	173	173
query55	75	66	64	64
query56	244	253	231	231
query57	1617	1618	1592	1592
query58	283	265	256	256
query59	2169	2200	1998	1998
query60	281	253	222	222
query61	152	143	147	143
query62	381	329	282	282
query63	202	161	161	161
query64	2764	939	787	787
query65	3352	3264	3270	3264
query66	1778	422	307	307
query67	20049	20111	19884	19884
query68	2865	1014	618	618
query69	379	287	248	248
query70	843	761	761	761
query71	285	239	212	212
query72	2677	2570	2395	2395
query73	513	532	303	303
query74	4628	4527	4345	4345
query75	2328	2295	1926	1926
query76	2308	1023	599	599
query77	358	380	281	281
query78	9588	9623	9146	9146
query79	998	869	533	533
query80	829	473	373	373
query81	570	320	269	269
query82	576	141	111	111
query83	310	197	185	185
query84	312	132	103	103
query85	941	478	367	367
query86	354	236	233	233
query87	1928	1972	1798	1798
query88	3730	2762	2754	2754
query89	331	276	238	238
query90	1793	168	171	168
query91	165	158	127	127
query92	101	92	87	87
query93	1001	997	573	573
query94	513	305	276	276
query95	567	315	298	298
query96	685	489	236	236
query97	2427	2402	2325	2325
query98	165	151	152	151
query99	756	775	648	648
Total cold run time: 233674 ms
Total hot run time: 150694 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.09	0.04	0.04
query3	0.25	0.09	0.09
query4	1.61	0.10	0.10
query5	0.23	0.24	0.24
query6	1.18	0.68	0.68
query7	0.04	0.00	0.00
query8	0.05	0.03	0.03
query9	0.40	0.36	0.33
query10	0.56	0.61	0.59
query11	0.20	0.14	0.13
query12	0.17	0.14	0.14
query13	0.48	0.48	0.50
query14	1.03	1.00	1.00
query15	0.63	0.63	0.61
query16	0.34	0.34	0.33
query17	1.18	1.16	1.11
query18	0.21	0.19	0.19
query19	2.11	1.98	1.98
query20	0.02	0.01	0.01
query21	15.47	0.20	0.14
query22	4.80	0.05	0.05
query23	16.27	0.33	0.12
query24	3.04	0.55	0.43
query25	0.10	0.06	0.06
query26	1.28	0.22	0.14
query27	0.04	0.04	0.03
query28	3.21	0.75	0.36
query29	12.50	4.19	3.34
query30	0.28	0.13	0.09
query31	2.77	0.56	0.32
query32	3.21	0.60	0.49
query33	3.23	3.25	3.13
query34	15.43	3.96	3.37
query35	3.34	3.31	3.33
query36	0.56	0.45	0.42
query37	0.09	0.07	0.06
query38	0.05	0.04	0.03
query39	0.04	0.03	0.03
query40	0.17	0.16	0.15
query41	0.08	0.03	0.03
query42	0.04	0.02	0.02
query43	0.04	0.04	0.04
Total cold run time: 96.83 s
Total hot run time: 24.24 s

@924060929

Copy link
Copy Markdown
Contributor Author

run buildall

@924060929

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Selected model is at capacity. Please try a different model.
Workflow run: https://github.com/apache/doris/actions/runs/40996230846

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17600	5204	5094	5094
q2	2170	320	261	261
q3	10209	1417	836	836
q4	4684	471	343	343
q5	7426	802	527	527
q6	185	190	157	157
q7	748	802	606	606
q8	9270	1346	1091	1091
q9	5471	4220	4186	4186
q10	6825	1288	1039	1039
q11	447	243	230	230
q12	635	403	288	288
q13	18101	3669	3021	3021
q14	279	274	244	244
q15	q16	757	717	645	645
q17	1205	742	579	579
q18	6981	6180	6129	6129
q19	1120	969	608	608
q20	399	345	228	228
q21	5293	2514	2488	2488
q22	384	330	277	277
Total cold run time: 100189 ms
Total hot run time: 28877 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	6064	5977	6130	5977
q2	714	586	562	562
q3	5673	5772	5381	5381
q4	2057	2166	1584	1584
q5	5780	5795	5644	5644
q6	247	203	147	147
q7	2190	2051	1821	1821
q8	3057	2804	2681	2681
q9	7989	7500	7492	7492
q10	3663	3616	3132	3132
q11	584	410	412	410
q12	680	677	516	516
q13	3380	3578	3056	3056
q14	279	295	264	264
q15	q16	666	691	625	625
q17	7779	7096	6893	6893
q18	12982	12192	12773	12192
q19	972	845	848	845
q20	2187	2150	1895	1895
q21	5872	4999	5029	4999
q22	499	461	435	435
Total cold run time: 73314 ms
Total hot run time: 66551 ms

@hello-stephen

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

query5	4336	601	451	451
query6	435	212	191	191
query7	4824	456	238	238
query8	318	167	160	160
query9	8808	3325	3289	3289
query10	477	317	254	254
query11	5924	3874	3598	3598
query12	158	88	87	87
query13	1273	455	341	341
query14	6146	4002	3661	3661
query14_1	3419	3424	3453	3424
query15	206	197	189	189
query16	947	426	413	413
query17	870	663	559	559
query18	2405	418	302	302
query19	185	166	134	134
query20	83	84	80	80
query21	206	126	108	108
query22	13063	13026	12897	12897
query23	13485	12992	12432	12432
query23_1	12584	12618	12449	12449
query24	7337	841	478	478
query24_1	496	495	499	495
query25	524	399	346	346
query26	1261	259	138	138
query27	2748	444	278	278
query28	4593	2098	2102	2098
query29	1566	592	437	437
query30	316	229	181	181
query31	1013	925	829	829
query32	150	94	88	88
query33	523	298	239	239
query34	906	879	522	522
query35	735	754	636	636
query36	813	796	716	716
query37	128	103	84	84
query38	1771	1740	1654	1654
query39	797	789	750	750
query39_1	716	723	731	723
query40	215	122	97	97
query41	66	64	64	64
query42	87	86	84	84
query43	348	365	311	311
query44	1382	722	738	722
query45	180	181	163	163
query46	867	988	591	591
query47	2981	3026	2859	2859
query48	323	325	246	246
query49	615	400	300	300
query50	711	277	210	210
query51	10697	10394	10340	10340
query52	85	81	73	73
query53	199	213	154	154
query54	225	196	194	194
query55	76	67	61	61
query56	233	216	225	216
query57	1665	1623	1574	1574
query58	294	264	253	253
query59	2116	2135	1977	1977
query60	301	246	231	231
query61	152	144	150	144
query62	391	336	278	278
query63	209	160	163	160
query64	2774	961	765	765
query65	3342	3296	3278	3278
query66	1773	421	305	305
query67	20159	20094	19877	19877
query68	3052	1024	634	634
query69	387	287	254	254
query70	887	796	774	774
query71	309	247	224	224
query72	2863	2726	2443	2443
query73	536	549	314	314
query74	4624	4512	4401	4401
query75	2358	2301	1932	1932
query76	2336	1054	646	646
query77	372	392	293	293
query78	9790	9767	9160	9160
query79	1028	855	570	570
query80	588	506	350	350
query81	553	327	273	273
query82	652	137	107	107
query83	319	200	197	197
query84	318	121	112	112
query85	811	444	376	376
query86	320	281	229	229
query87	2026	1952	1830	1830
query88	3934	2880	2881	2880
query89	335	286	243	243
query90	1881	177	159	159
query91	163	149	128	128
query92	100	91	91	91
query93	1030	1023	584	584
query94	436	306	271	271
query95	587	326	305	305
query96	706	495	247	247
query97	2433	2425	2325	2325
query98	166	151	158	151
query99	756	768	650	650
Total cold run time: 235464 ms
Total hot run time: 152053 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 59.85% (164/274) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

query1	0.01	0.00	0.01
query2	0.10	0.06	0.05
query3	0.26	0.09	0.09
query4	1.60	0.09	0.11
query5	0.26	0.24	0.23
query6	1.17	0.68	0.66
query7	0.04	0.01	0.01
query8	0.06	0.04	0.03
query9	0.40	0.34	0.35
query10	0.61	0.57	0.59
query11	0.20	0.14	0.14
query12	0.17	0.14	0.15
query13	0.51	0.49	0.50
query14	1.04	1.03	1.01
query15	0.64	0.63	0.61
query16	0.34	0.35	0.35
query17	1.14	1.09	1.15
query18	0.21	0.19	0.19
query19	2.11	1.93	1.93
query20	0.02	0.01	0.02
query21	15.47	0.22	0.14
query22	4.77	0.05	0.05
query23	16.22	0.34	0.12
query24	3.17	0.60	0.33
query25	0.11	0.06	0.06
query26	1.12	0.20	0.14
query27	0.06	0.04	0.04
query28	2.97	0.79	0.36
query29	12.48	4.13	3.24
query30	0.28	0.13	0.10
query31	2.77	0.56	0.33
query32	3.23	0.60	0.50
query33	3.18	3.24	3.21
query34	15.25	4.00	3.37
query35	3.31	3.35	3.33
query36	0.55	0.44	0.43
query37	0.08	0.06	0.06
query38	0.04	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	0.14	0.14
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.05	0.04	0.03
Total cold run time: 96.35 s
Total hot run time: 24.14 s

@924060929
924060929 force-pushed the codex/remove-legacy-coordinator branch from 16a78e4 to 8b305ab Compare October 30, 2026 06:53
@924060929

Copy link
Copy Markdown
Contributor Author

run buildall

@924060929

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Selected model is at capacity. Please try a different model.
Workflow run: https://github.com/apache/doris/actions/runs/41016791795

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@morrySnow morrySnow changed the title [refactor](fe) Unify query execution in Coordinator [refactor](coordinator) Unify query execution in Coordinator Nov 4, 2026
morrySnow
morrySnow previously approved these changes Nov 4, 2026
### What problem does this PR solve?

Issue Number: N/A

Problem Summary:

FE still carries two execution coordinators: the legacy `Coordinator` assigns scan ranges and fragment instances itself, while `NereidsCoordinator` executes Nereids distributed plans but inherits the legacy coordinator's state and initialization. `CloudCoordinator` adds another legacy-only factory branch. This duplicates scheduling and lifecycle ownership and retains a fallback that newer execution features do not support.

Replace the legacy implementation with the standalone Nereids implementation, renamed to `Coordinator`, and remove `NereidsCoordinator` and `CloudCoordinator`. SQL, INSERT and background load creation now use the same factory. Cloud compute-group selection, privilege validation and backend membership remain in `BackendDistributedPlanWorkerManager` during distributed planning.

Preserve the remaining shared capabilities explicitly: HTTP Stream Load generates parameters with `ThriftPlansBuilder`; Arrow Flight retains scans that must outlive dispatch; streaming INSERT retains scan backend IDs; cancellation uses the runtime task state, without treating remote-catalog workers as local backends. Group-commit backend selection remains in distributed planning.

Retire `enable_nereids_distribute_planner` using the existing removed-variable handling and remove its legacy-only optimizer branches. Migrate relevant unit coverage and remove regression assertions that specifically required the deleted legacy scheduling path; keep their result checks.

### Release note

Use Nereids distributed planning for all queries and loads. `enable_nereids_distribute_planner` no longer selects a planner; existing SET statements for this removed variable remain accepted.

### Check List (For Author)

- Test: `./build.sh --fe --exclude-obs-dependencies --exclude-cos-dependencies`; FE Checkstyle (0 violations); 205 focused FE unit cases across 19 classes, including ordinary and group-commit HTTP stream planning. Corrected test fixtures were rerun separately. OBS/COS plugin packaging and full BE-backed regression were not run locally.
- Behavior changed: Yes. Remove the legacy scheduling fallback and always use Nereids distributed planning.
- Does this need documentation: No; the retired variable is hidden by the existing removed-variable mechanism.
### What problem does this PR solve?

Problem Summary: HTTP Stream Load consumes one BE-owned input stream and completes one StreamLoadContext. Nereids local shuffle could expand its plan to eight instances, invoking the BE completion callback repeatedly and satisfying the same promise more than once. Keep FILE_STREAM TVF scans on one instance during distribution and assert that contract before returning the HTTP plan. Strengthen ordinary and group-commit planning tests with parallel_pipeline_task_num=8.

Always-on distribution also exposed missing query IDs in shared FE unit-test contexts and missing worker setup in the cloud table-stream metadata fixture. Initialize identity centrally, retain real distribution on fixture backends, apply the test heartbeat interval to an Env already initialized by static fixtures, and update the UNION regression's obsolete legacy-plan expectations.

### Release note

None

### Check List (For Author)

- Test: 529 FE unit cases passed across 39 classes (3 existing skipped cases); FE Checkstyle; FE build with OBS/COS packaging excluded. Full BE-backed regression was not run locally.
- Behavior changed: Yes. Preserve HTTP Stream Load's single-instance completion contract with Nereids distribution.
- Does this need documentation: No
### What problem does this PR solve?

Problem Summary: Always-on Nereids distribution inserts local exchanges into translated plans and requires valid query identity and available workers during planning. Aggregate translator tests assumed direct scan/aggregate adjacency, and SQL-cache tests suppressed query-id writes and supplied no backend. Ignore only intra-fragment local-exchange wrappers when asserting the aggregate structure, and initialize the cache fixture with a real query ID and an available backend.

Regenerate 114 EXPLAIN-shape golden files for the Nereids distribution/property path using the original regression SQL and statistics. Keep existing query-result golden sections unchanged.

### Release note

None

### Check List (For Author)

- Test: 25 focused FE unit cases passed; 113 shape suites and the alias-through-join EXPLAIN suite passed comparison runs using real FE planning with mock backends and the original injected statistics. FE build and Checkstyle passed with OBS/COS packaging excluded. Full BE-backed query-result regression was not run locally.
- Behavior changed: No production behavior changes in this follow-up.
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: N/A

Problem Summary: Preserve the master branch's split-generation stop and per-scan cleanup behavior when renaming NereidsCoordinator to Coordinator. Verify that the coordinator context reaches the active scan nodes and that a failing scan cleanup does not prevent remaining scans from closing.

### Release note

None

### Check List (For Author)

- Test: FE build and Checkstyle passed; 78 focused FE unit cases across six classes passed.
- Behavior changed: No; retain master behavior while unifying coordinators.
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: N/A

Problem Summary: The unified distributed planner permits bucket shuffle for set operations when local shuffle is disabled. The translator still gated the set-operation bucket-shuffle marker on the FE local-shuffle planner flag. A pruned basic scan could therefore omit receivers for buckets targeted by another branch. Derive the marker from the selected child distribution, leaving legality and alignment in the property regulator. Cover UNION and EXCEPT with pruned scans, all four local-shuffle flag combinations, and complete receiver bucket allocation.

### Release note

Preserve set-operation bucket receivers when local shuffle is disabled.

### Check List (For Author)

- Test: 36 focused FE unit cases passed (set-operation translation, bucketed aggregation, bucket scheduling, Coordinator). Full FE build and Checkstyle passed. Full BE-backed result regression was not run locally.
- Behavior changed: Yes; retain missing-bucket receivers for allowed bucket-shuffle set operations with local shuffle disabled.
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: N/A

Problem Summary: Coordinator cancellation delegates to the runtime fragment health check, which required both captured and current backend epochs to be positive before detecting a restart. Queries captured at an initial -1 or replayed 0 epoch could miss a subsequent positive epoch and wait until execution timeout. Match the legacy restart comparison in the shared health method: ignore a current zero epoch for replay/upgrade compatibility, but reject all other changed epochs. Add unit and Coordinator integration coverage for both initial values and the current-zero exception.

### Release note

Cancel queries promptly when a backend epoch changes after an uninitialized epoch was captured.

### Check List (For Author)

- Test: Four new assertions reproduced the failure before the fix; 31 focused FE unit cases passed after the fix. Full FE build and Checkstyle passed.
- Behavior changed: Yes; restore cancellation on backend restart after a nonpositive captured epoch.
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: N/A

Problem Summary: The eliminate_outer_join suite still expects the legacy shuffle label for a nested full outer join. Regenerate the EXPLAIN expectations with the unified Nereids distribution path. The generated output changes exactly the shuffle label reported by P0 CI; all other plan output is unchanged.

### Release note

None

### Check List (For Author)

- Test: run-regression-test.sh generated the output and a separate comparison run passed all 29 EXPLAIN checks in the suite. Used real FE planning and three mock backends; no BE query-result execution was needed for these EXPLAIN-only checks.
- Behavior changed: No
- Does this need documentation: No
…lism

### What problem does this PR solve?

Issue Number: N/A

Problem Summary: The nested full-outer-join EXPLAIN expectation generated with low pipeline parallelism fails when Cloud P0 fuzzes parallel_pipeline_task_num to 7. Bucket-shuffle downgrade uses the actual backend count and pipeline parallelism, which be_number_for_test does not pin. Scope bucket_shuffle_downgrade_ratio=0 to this statement so the test continues checking outer-join elimination with a stable distribution choice. Leave production heuristics, other statements and golden output unchanged.

### Release note

None

### Check List (For Author)

- Test: Reproduced the original Cloud P0 mismatch with three mock backends and pipeline parallelism 7. All 29 EXPLAIN checks passed through run-regression-test.sh in four combinations of one/three mock backends and pipeline parallelism one/seven. Regenerated output is byte-identical to the committed golden. Real FE planning was used; no BE query-result execution or new FE build was needed for this SQL-only test change.
- Behavior changed: No
- Does this need documentation: No
…citly

### What problem does this PR solve?

Issue Number: N/A

Problem Summary: The removed enable_nereids_distribute_planner switch no longer forces partitioned joins. test_outer_join still assumes that behavior, while earlier coordinator migration removed partitioned exchange assertions from two distribution suites. Select supported distributions with effective statement-scoped join settings instead: retain both partitioned and bucket-shuffle checks and make the pruning suite exercise its intended bucket path without an early skip. Keep query-result assertions, production heuristics and golden files unchanged.

### Release note

None

### Check List (For Author)

- Test: Audited all 1225 files with false settings. All 1204 shape scripts compared successfully using real FE planning, original statistics and mock backends across the tested backend/parallelism configurations. Reproduced the stale outer-join assertion in a one-backend fixture; its six replacement paths passed with one/three backends and parallelism one/seven. The two distribution plan probes passed with one backend and parallelism one/seven/sixteen. Full BE-backed result execution and a new production FE build were not performed for this Groovy-only change.
- Behavior changed: No
- Does this need documentation: No
…ation

### What problem does this PR solve?

Related PR: apache#69830

Problem Summary: The unified coordinator permits shuffling the left intermediate result onto the right table's storage buckets. For the TopN-through-distinct-left-join shape test, this alternative can select a one-phase aggregate instead of the expected two-phase aggregate. Disable bucket shuffle only for that EXPLAIN so the test keeps checking its original TopN rewrite shape. Preserve the result queries and all existing goldens.

### Release note

None

### Check List (For Author)

- Test: Reproduced the CI shape mismatch with real FE planning and mock backends using the original DDL and statistics matching the eight input rows. Both shape checks pass through run-regression-test.sh with 1/3 mock backends and parallel_pipeline_task_num=1/7/16. The modified Groovy source parses successfully; git diff --check passes. Real BE result execution remains for CI.
- Behavior changed: No
- Does this need documentation: No
### What problem does this PR solve?

Related PR: apache#69830

Problem Summary: Master added a pre-lock partition-view warmup decision that still calls the legacy distribute-planner switch. After coordinator unification that method no longer exists, and every executable or distributed EXPLAIN plan uses Nereids distribution. Remove the obsolete switch and dictionary exceptions, and share one finalization predicate between warmup selection and actual distribution. Update the existing planner tests to cover all EXPLAIN levels.

### Release note

None

### Check List (For Author)

- Test: 181 focused FE unit tests passed via run-fe-ut.sh, covering Coordinator, cloud workers, transport, INSERT, dictionary drop races, Nereids planning, partition preloading, CTE pruning, statement execution, and session variables. build.sh --fe --exclude-obs-dependencies --exclude-cos-dependencies passed with zero Checkstyle violations. Local output deployment used GNU cp to preserve existing configuration files without the macOS cp -n exit-status issue.
- Behavior changed: No additional behavior beyond the unified-distribution refactor
- Does this need documentation: No
@924060929

Copy link
Copy Markdown
Contributor Author

run buildall

@924060929

Copy link
Copy Markdown
Contributor Author

Local pipeline review — ✅ PASS

schema: doris-repo-review/v1
status: PASS
pr: apache/doris#69830
commit: 43e43e104ca8d21386138a5ff2be378bb2bec17e
base: 11bfb7388944340181e7e4bef55c7629ea44e902
reviewed_at: 2026-11-04T10:22+08:00
reviewer: 924060929
model: gpt-6.1-sol
effort: xhigh
findings: {blocker: 0, major: 0, minor: 0, nit: 0}
rounds: 1
converged: true

Notes for maintainers

  • This review used one gpt-6.1-sol/xhigh reviewer at the user's explicit request; all risk verification, coverage and convergence were performed by that reviewer, with no independent subagents or additional Codex process.
  • Re-review after the 2026-11-04 master conflict resolution: all 179 changed files are covered; 176 complete diff blocks and both source-side blobs match the previous qualified review of 61aded4. The three changed blocks and the upstream external-report rejection/cancellation interaction were freshly inspected.
  • Read-only source review: no builds, tests, benchmarks or live-cluster execution were performed. Existing CI and author validation records are supporting context only.

Reviewed locally with the doris-repo-review pipeline. Repository policy may accept this receipt for the matching commit; it is not a human Apache approval.

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17573	5174	5030	5030
q2	2152	315	245	245
q3	10236	1386	808	808
q4	4682	468	337	337
q5	7429	787	527	527
q6	182	180	150	150
q7	744	791	600	600
q8	9247	1295	1049	1049
q9	5360	4199	4168	4168
q10	6823	1274	1053	1053
q11	436	236	232	232
q12	637	402	283	283
q13	18104	3578	3018	3018
q14	278	267	243	243
q15	q16	743	712	667	667
q17	1227	749	576	576
q18	7033	6208	6138	6138
q19	1105	948	588	588
q20	383	330	218	218
q21	5144	2079	2249	2079
q22	336	291	248	248
Total cold run time: 99854 ms
Total hot run time: 28257 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5562	5571	5562	5562
q2	677	567	542	542
q3	5201	5416	4978	4978
q4	1983	2120	1543	1543
q5	5299	5201	5641	5201
q6	268	207	158	158
q7	2312	2132	1963	1963
q8	3038	2920	2689	2689
q9	8206	8245	7998	7998
q10	3708	3667	3247	3247
q11	605	433	404	404
q12	675	700	506	506
q13	3647	3871	3208	3208
q14	298	311	293	293
q15	q16	719	721	672	672
q17	8469	7566	6921	6921
q18	12922	12144	12891	12144
q19	907	784	799	784
q20	2100	2106	1940	1940
q21	5506	4551	4706	4551
q22	484	434	384	384
Total cold run time: 72586 ms
Total hot run time: 65688 ms

@hello-stephen

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

query5	4310	580	432	432
query6	429	211	197	197
query7	4795	451	224	224
query8	326	196	155	155
query9	8785	3166	3208	3166
query10	465	304	249	249
query11	6034	3858	3570	3570
query12	142	91	87	87
query13	1244	436	341	341
query14	6070	3921	3667	3667
query14_1	3432	3413	3384	3384
query15	203	197	184	184
query16	934	416	418	416
query17	857	649	549	549
query18	2414	424	311	311
query19	193	160	144	144
query20	88	85	82	82
query21	209	134	106	106
query22	12891	12863	12803	12803
query23	13528	12930	12459	12459
query23_1	12547	12621	12443	12443
query24	7393	824	475	475
query24_1	480	502	477	477
query25	544	429	366	366
query26	1238	254	138	138
query27	2782	442	282	282
query28	4600	2032	2024	2024
query29	1544	606	447	447
query30	306	216	189	189
query31	1005	936	805	805
query32	141	90	89	89
query33	524	288	244	244
query34	871	843	509	509
query35	740	784	649	649
query36	819	809	757	757
query37	128	99	87	87
query38	1770	1715	1663	1663
query39	788	789	742	742
query39_1	739	728	736	728
query40	232	121	98	98
query41	71	69	71	69
query42	88	84	83	83
query43	342	357	310	310
query44	1303	706	707	706
query45	184	175	167	167
query46	819	969	570	570
query47	2872	2858	2653	2653
query48	299	314	218	218
query49	574	400	312	312
query50	672	275	221	221
query51	10625	10476	10409	10409
query52	76	79	69	69
query53	196	206	165	165
query54	238	189	185	185
query55	69	67	61	61
query56	241	209	206	206
query57	1653	1617	1590	1590
query58	288	260	257	257
query59	2201	2216	2062	2062
query60	283	250	226	226
query61	146	151	147	147
query62	402	336	287	287
query63	189	158	159	158
query64	2712	993	802	802
query65	3336	3275	3267	3267
query66	1756	405	302	302
query67	20111	20346	20045	20045
query68	3282	1005	621	621
query69	376	283	245	245
query70	835	784	758	758
query71	293	228	247	228
query72	2824	2594	2287	2287
query73	505	527	293	293
query74	4631	4522	4335	4335
query75	2352	2294	1900	1900
query76	2389	1009	585	585
query77	354	370	275	275
query78	10060	9790	9230	9230
query79	980	858	539	539
query80	641	439	344	344
query81	561	325	270	270
query82	582	132	107	107
query83	254	191	175	175
query84	311	125	106	106
query85	813	430	375	375
query86	330	238	232	232
query87	2023	1934	1805	1805
query88	3760	2773	2750	2750
query89	336	281	245	245
query90	1855	157	164	157
query91	160	147	124	124
query92	99	87	87	87
query93	997	986	582	582
query94	455	314	269	269
query95	588	316	360	316
query96	690	481	239	239
query97	2467	2419	2325	2325
query98	163	168	151	151
query99	772	763	656	656
Total cold run time: 234775 ms
Total hot run time: 151275 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.10	0.05	0.05
query3	0.26	0.09	0.08
query4	1.60	0.09	0.11
query5	0.22	0.24	0.24
query6	1.19	0.67	0.68
query7	0.03	0.01	0.01
query8	0.06	0.04	0.03
query9	0.40	0.36	0.34
query10	0.57	0.58	0.60
query11	0.20	0.15	0.14
query12	0.18	0.14	0.14
query13	0.50	0.50	0.49
query14	1.02	1.02	1.01
query15	0.63	0.61	0.62
query16	0.36	0.35	0.34
query17	1.09	1.12	1.11
query18	0.20	0.19	0.20
query19	2.05	1.97	2.01
query20	0.02	0.01	0.01
query21	15.45	0.19	0.13
query22	4.90	0.05	0.06
query23	16.29	0.32	0.13
query24	3.09	0.53	0.34
query25	0.12	0.05	0.04
query26	1.05	0.22	0.16
query27	0.04	0.04	0.04
query28	3.37	0.79	0.36
query29	12.50	4.13	3.24
query30	0.29	0.13	0.10
query31	2.77	0.56	0.34
query32	3.23	0.61	0.51
query33	3.19	3.18	3.28
query34	15.27	4.06	3.40
query35	3.35	3.36	3.36
query36	0.57	0.45	0.44
query37	0.08	0.06	0.06
query38	0.06	0.04	0.04
query39	0.03	0.02	0.02
query40	0.18	0.16	0.15
query41	0.09	0.03	0.03
query42	0.04	0.03	0.02
query43	0.04	0.04	0.03
Total cold run time: 96.69 s
Total hot run time: 24.28 s

@924060929
924060929 merged commit b0fd495 into apache:master Nov 4, 2026
39 of 40 checks passed
@924060929
924060929 deleted the codex/remove-legacy-coordinator branch November 4, 2026 06:48
morningman added a commit that referenced this pull request Nov 5, 2026
…0163)

### What problem does this PR solve?

Issue Number: None

Related PR: #68206, #68636, #68368

Problem Summary:

**In short.** Three branch-4.2 backports of master fixes each added a
test: #68206 (of #61342), #68636 (of #57006) and #68368 (of #66354).
Master has the three fixes but none of the tests. This PR ports them.
Two guard a fix that has no test on master; the third keeps the
ClickBench `query1` shape case from failing whenever the exact row count
of `hits` is cached. The PR changes tests only.

**Background, and what each test covers.**

- *Old primary key metadata (#61342, #68206).* A `PrimaryKeyConstraint`
written before its foreign table collections existed has no `ft`, `ftn`
or `ftni` in its JSON. Gson builds the object without its field
initializers, so these stay null unless `gsonPostProcess` fills them in,
and an FE that replays the journal from the start (without an image, or
with `metadata_failure_recovery`) failed with a NullPointerException.
#61342 added the null checks without a test; #68206 added one on
branch-4.2 for `ft`, the only collection there. The new
`PrimaryKeyConstraintTest` removes all three from a serialized
constraint, loads it, and adds, renames and removes a foreign table on
it.
- *Shadow index columns (#57006, #68636).* During a schema change the
new schema names a changed column `__doris_shadow_<name>`.
`Index.getColumnUniqueIds` compares the index's column names with the
schema's after `Column.removeNamePrefix`, so the new tablet metadata
keeps the index column's unique id. #57006 has no test; #68636 added one
to `IndexTest`, ported here to JUnit 5.
- *ClickBench query1 shape (#66354, #68368).*
`shape_check/clickbench/query1` checks the plan of `SELECT COUNT(*) FROM
hits`. Once `SimpleAggCacheMgr` has cached the exact row count of
`hits`, `REWRITE_SIMPLE_AGG_TO_CONSTANT` turns the count into a constant
and the shape into `PhysicalOneRowRelation`, so the case fails whenever
that cache is warm when it runs. It did on P0 for #69830 (build 1087320:
expected `--hashAgg[GLOBAL]`, real `--PhysicalOneRowRelation`), a PR
that does not touch the planner. On branch-4.2, #68368 disables the rule
in this case together with the cost model change it backports, which
master has from #66354. This PR disables it the same way; the expected
output does not change.

**Results.**

| Change | Test | Result |
|---|---|---|
| none | `PrimaryKeyConstraintTest` (new), `IndexTest` (one new case),
`ConstraintManagerTest`, `ConstraintPersistTest` | pass |
| `gsonPostProcess` without its null checks | `PrimaryKeyConstraintTest`
| fails: NullPointerException while loading |
| `getColumnUniqueIds` without `removeNamePrefix` |
`IndexTest#testGetColumnUniqueIdsForShadowColumn` | fails: `expected
[107] but was []` |
| `query1` as on master, row count of `hits` cached (local cluster) |
`shape_check/clickbench/query1` | fails: `PhysicalOneRowRelation` |
| `query1` with this PR, same cache | `shape_check/clickbench/query1` |
passes |

On the local cluster, `explain shape plan SELECT COUNT(*) FROM hits`
gives `hashAgg[GLOBAL]` the first time and `PhysicalOneRowRelation`
three seconds later, once the asynchronous row count load has finished;
with the rule disabled it stays `hashAgg[GLOBAL]`.

Co-authored-by: minghong <[email protected]>
Co-authored-by: Jack <[email protected]>
Co-authored-by: feiniaofeiafei <[email protected]>
englefly added a commit that referenced this pull request Nov 6, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: #69830

Problem Summary: Coordinator unification removed the legacy distributed planner
and SessionVariable.isEnableNereidsDistributePlanner(), but GroupJoin translation
and its conjunct-alignment postprocessor still called that getter. FE compilation
failed with cannot-find-symbol errors in both paths. Remove the obsolete gates
while preserving the fusion switch and backend capability checks. Update the
bucket-shuffle regression to require fusion when the removed planner switch is
set to false, since that switch no longer selects a legacy planner.

### Release note

None

### Check List (For Author)

- Test:
    - Manual test: ./build.sh --fe -j8 passed, including Checkstyle.
    - Manual test: ./build.sh --be -j12 passed with BUILD_TYPE=ASAN.
    - Unit Test: ./run-fe-ut.sh --run with GroupJoinFusionUtilsTest,
      PlanFragmentBucketShuffleTest and
      CoordinatorTest#testRemovedSwitchCannotSelectLegacyScheduling passed
      (9 tests, 0 failures, 0 errors).
    - Updated the bucket-shuffle regression; the regression suite was not run.
- Behavior changed: No. The removed planner switch is already ignored on master.
- Does this need documentation: No
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.

5 participants