Skip to content

[feature](compute group) Support show compute groups in non cloud mode - #66697

Open
deardeng wants to merge 2 commits into
apache:masterfrom
deardeng:show-cluster-for-non-cloud
Open

[feature](compute group) Support show compute groups in non cloud mode#66697
deardeng wants to merge 2 commits into
apache:masterfrom
deardeng:show-cluster-for-non-cloud

Conversation

@deardeng

@deardeng deardeng commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

SHOW CLUSTERS / SHOW COMPUTE GROUPS were rejected with ERR_NOT_CLOUD_MODE in non cloud mode. In non cloud mode a resource group (the backend location tag) is the counterpart of a cloud compute group, so show it instead:

  • only Name/BackendNum (cluster/backend_num for SHOW CLUSTERS) are shown, IsCurrent/Users/SubComputeGroups/Policy/Properties are cloud only.
  • a user only sees the resource groups it is allowed to use, which is the compute group resolved from resource_tags.location, the same visibility the query engine uses to pick backends. This replaces the global ADMIN check, and matches cloud mode where clusters are filtered by usage priv.
image

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

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

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

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

SHOW CLUSTERS / SHOW COMPUTE GROUPS were rejected with ERR_NOT_CLOUD_MODE
in non cloud mode. In non cloud mode a resource group (the backend location
tag) is the counterpart of a cloud compute group, so show it instead:

- only Name/BackendNum (cluster/backend_num for SHOW CLUSTERS) are shown,
  IsCurrent/Users/SubComputeGroups/Policy/Properties are cloud only.
- a user only sees the resource groups it is allowed to use, which is the
  compute group resolved from resource_tags.location, the same visibility
  the query engine uses to pick backends. This replaces the global ADMIN
  check, and matches cloud mode where clusters are filtered by usage priv.
@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?

@deardeng

Copy link
Copy Markdown
Contributor Author

run buildall

@deardeng

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: add an exact BackendNum regression fence for the new non-cloud branch.

Critical checkpoint conclusions:

  • Goal and scope: The production change is small and focused, and the traced implementation achieves the stated goal: both SHOW CLUSTERS and SHOW COMPUTE GROUPS expose non-cloud location-tag groups with mode-appropriate two-column metadata. The central new exact count is not proved by the changed tests, as described inline.
  • Data correctness and authorization: Direct MySQL, forwarded, and fallback contexts resolve the same ComputeGroup membership used by query scheduling. Default, single-tag, multi-tag, root/admin all-backend, and invalid groups were traced; no extra group exposure, dropped allowed group, or throwing subtype path was found. Resource tags are scheduling/QoS hints rather than a tenant-isolation boundary under the repository threat model.
  • Concurrency, lifecycle, and error handling: The command reads one copy-on-write backend membership snapshot, adds no locks or heavy work under locks, and introduces no new lifecycle/static-initialization or silent-error path. Per-backend tag changes retain the existing non-atomic DDL observation semantics.
  • Compatibility and parallel paths: The cloud row construction and USAGE filtering remain unchanged. Both SQL spellings, direct/proxy result handling, mode-dependent metadata widths, all registered backend roles/states, and the existing cloud count semantics were checked; no FE/BE protocol, persistence, transaction, configuration, storage-format, or rolling-upgrade surface is introduced.
  • Tests: The new regression covers both spellings, authenticated single-tag filtering, invalid-tag emptiness, row width, and deterministic order. Existing unit coverage exercises the unchanged compute-group subtype primitives. However, every changed count assertion still passes for a constant positive value, and the FE test starts only one backend, so a same-tag multi-backend exact total is required to prove the new groupingBy(..., counting()) behavior.
  • Performance and observability: The new work is one backend scan plus group sorting, with no material hot-path or memory concern. Existing diagnostics are sufficient for this local metadata operation.

No additional user-provided review focus was supplied. The review converged after two full rounds: all Round 2 reviewers returned NO_NEW_VALUABLE_FINDINGS; one inline issue was accepted, and the other candidates were dismissed with concrete test-runner and existing-coverage evidence.

No local build or test was run because the authoritative review instructions prohibit builds in this runner.

Comment thread regression-test/suites/show_p0/test_show_compute_groups.groovy
@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17710	4100	4190	4100
q2	2014	341	216	216
q3	10262	1418	849	849
q4	4681	477	344	344
q5	7515	892	566	566
q6	200	182	145	145
q7	834	821	600	600
q8	9388	1594	1622	1594
q9	5435	4149	4146	4146
q10	6742	1650	1359	1359
q11	529	367	319	319
q12	756	591	473	473
q13	18082	3310	2750	2750
q14	271	270	248	248
q15	q16	744	742	675	675
q17	1029	988	1038	988
q18	6626	5616	5599	5599
q19	1318	1267	1026	1026
q20	805	688	537	537
q21	5936	2669	2359	2359
q22	432	365	307	307
Total cold run time: 101309 ms
Total hot run time: 29200 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4478	4400	4356	4356
q2	291	346	218	218
q3	4600	4945	4383	4383
q4	2250	2334	1438	1438
q5	4296	4192	4167	4167
q6	238	178	137	137
q7	1762	1664	1884	1664
q8	2630	2308	2284	2284
q9	7655	7665	7367	7367
q10	4330	4315	3842	3842
q11	545	451	398	398
q12	757	760	566	566
q13	3203	3551	2877	2877
q14	304	310	268	268
q15	q16	701	727	660	660
q17	1383	1331	1363	1331
q18	12108	11022	11966	11022
q19	1235	1187	1131	1131
q20	2247	2263	1938	1938
q21	5882	5038	5057	5038
q22	556	493	412	412
Total cold run time: 61451 ms
Total hot run time: 55497 ms

@hello-stephen

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

query5	4313	599	466	466
query6	453	222	211	211
query7	4839	573	326	326
query8	324	165	151	151
query9	8763	4086	4103	4086
query10	491	339	315	315
query11	5826	2215	2036	2036
query12	162	100	98	98
query13	1280	594	440	440
query14	6144	4364	4097	4097
query14_1	3886	3906	3883	3883
query15	206	196	181	181
query16	972	464	440	440
query17	938	695	579	579
query18	2442	482	364	364
query19	208	191	153	153
query20	103	103	104	103
query21	234	165	146	146
query22	13041	13165	12901	12901
query23	15863	15261	14640	14640
query23_1	14740	14616	14537	14537
query24	7600	1738	1252	1252
query24_1	1282	1242	1277	1242
query25	557	452	386	386
query26	1330	340	225	225
query27	2590	622	395	395
query28	4552	2061	2021	2021
query29	1089	628	496	496
query30	350	269	233	233
query31	1191	1126	1046	1046
query32	114	69	64	64
query33	538	321	255	255
query34	1195	1157	646	646
query35	757	772	660	660
query36	785	782	718	718
query37	156	110	95	95
query38	1845	1781	1688	1688
query39	837	828	810	810
query39_1	799	791	800	791
query40	254	168	150	150
query41	74	72	68	68
query42	99	98	94	94
query43	341	332	292	292
query44	1482	772	768	768
query45	185	176	175	175
query46	1047	1177	714	714
query47	1545	1550	1469	1469
query48	409	433	292	292
query49	641	392	295	295
query50	1090	417	344	344
query51	10520	10721	10713	10713
query52	90	88	75	75
query53	249	283	206	206
query54	276	237	223	223
query55	74	72	68	68
query56	308	315	314	314
query57	1012	997	920	920
query58	283	265	255	255
query59	1565	1620	1392	1392
query60	299	263	265	263
query61	149	147	144	144
query62	399	318	267	267
query63	243	196	201	196
query64	2864	1068	827	827
query65	3868	3816	3797	3797
query66	1827	467	368	368
query67	20209	20052	20029	20029
query68	3402	1566	1015	1015
query69	411	302	274	274
query70	889	815	797	797
query71	372	337	333	333
query72	3106	2753	2267	2267
query73	874	775	452	452
query74	4665	4509	4329	4329
query75	2390	2329	2006	2006
query76	2432	1160	773	773
query77	353	374	277	277
query78	11304	10994	10580	10580
query79	1390	1112	762	762
query80	1226	555	468	468
query81	531	327	286	286
query82	663	171	139	139
query83	403	337	309	309
query84	334	161	131	131
query85	951	614	519	519
query86	410	239	228	228
query87	2008	1979	1846	1846
query88	3808	2808	2834	2808
query89	408	339	292	292
query90	1912	210	204	204
query91	206	198	164	164
query92	71	63	69	63
query93	1609	1523	941	941
query94	722	337	329	329
query95	835	606	476	476
query96	1137	807	352	352
query97	2483	2514	2331	2331
query98	194	191	182	182
query99	745	723	615	615
Total cold run time: 246548 ms
Total hot run time: 159504 ms

@hello-stephen

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

query1	0.00	0.00	0.01
query2	0.09	0.06	0.05
query3	0.25	0.13	0.14
query4	1.61	0.14	0.14
query5	0.25	0.23	0.23
query6	1.16	0.86	0.81
query7	0.04	0.01	0.00
query8	0.06	0.04	0.04
query9	0.39	0.32	0.33
query10	0.57	0.59	0.57
query11	0.21	0.14	0.14
query12	0.18	0.14	0.14
query13	0.47	0.46	0.47
query14	1.00	0.98	1.01
query15	0.61	0.59	0.61
query16	0.32	0.32	0.33
query17	1.10	1.10	1.16
query18	0.21	0.21	0.20
query19	2.08	1.95	1.90
query20	0.02	0.01	0.01
query21	15.44	0.18	0.14
query22	4.94	0.05	0.05
query23	16.13	0.31	0.12
query24	3.18	0.42	0.33
query25	0.10	0.07	0.04
query26	0.74	0.21	0.14
query27	0.05	0.04	0.05
query28	3.51	0.76	0.35
query29	12.46	3.99	3.18
query30	0.29	0.15	0.15
query31	2.77	0.55	0.31
query32	3.22	0.59	0.49
query33	3.13	3.17	3.13
query34	15.48	3.93	3.28
query35	3.24	3.21	3.22
query36	0.57	0.45	0.44
query37	0.09	0.07	0.07
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.17	0.14	0.13
query41	0.09	0.04	0.03
query42	0.04	0.03	0.03
query43	0.04	0.03	0.04
Total cold run time: 96.39 s
Total hot run time: 23.89 s

### What problem does this PR solve?

Issue Number: None

Related PR: apache#66697

Problem Summary: The non-cloud SHOW CLUSTERS and SHOW COMPUTE GROUPS tests only checked positive backend counts with a single backend, so they could not detect incorrect aggregation when multiple backends shared a location tag. Add deterministic FE unit coverage and a three-backend Docker regression that splits backends across multiple location groups and verifies exact counts for both SHOW forms.

### Release note

None

### Check List (For Author)

- Test:
    - Unit Test: ./run-fe-ut.sh --run org.apache.doris.nereids.trees.plans.commands.ShowComputeGroupTest
    - Regression test: ./run-regression-test.sh --run -d show_p0 -s test_show_compute_groups_docker -runMode not_cloud
- Behavior changed: No
- Does this need documentation: No
@deardeng

Copy link
Copy Markdown
Contributor Author

run buildall

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.

2 participants