Skip to content

[enhancement](workload policy) Add username-based backend workload policy support#60559

Open
wenzhenghu wants to merge 12 commits intoapache:masterfrom
HYDCP:workloadpolicy_be_username
Open

[enhancement](workload policy) Add username-based backend workload policy support#60559
wenzhenghu wants to merge 12 commits intoapache:masterfrom
HYDCP:workloadpolicy_be_username

Conversation

@wenzhenghu
Copy link
Contributor

@wenzhenghu wenzhenghu commented Feb 6, 2026

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

@Thearas
Copy link
Contributor

Thearas commented Feb 6, 2026

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?

@wenzhenghu
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.29% (1792/2260)
Line Coverage 64.74% (31825/49158)
Region Coverage 65.43% (15886/24280)
Branch Coverage 55.98% (8440/15078)

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 3.57% (1/28) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.55% (19376/36869)
Line Coverage 36.06% (180041/499305)
Region Coverage 32.43% (139588/430491)
Branch Coverage 33.43% (60455/180850)

@wenzhenghu
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.29% (1792/2260)
Line Coverage 64.74% (31826/49158)
Region Coverage 65.43% (15886/24280)
Branch Coverage 55.96% (8438/15078)

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 29.17% (7/24) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17661	4492	4381	4381
q2	2019	368	253	253
q3	10448	1426	759	759
q4	10379	794	307	307
q5	9617	2268	2015	2015
q6	228	179	150	150
q7	900	777	620	620
q8	9281	1533	1266	1266
q9	5063	4615	4653	4615
q10	6849	1957	1537	1537
q11	527	325	289	289
q12	403	379	229	229
q13	17849	4106	3306	3306
q14	229	235	222	222
q15	918	826	797	797
q16	705	682	623	623
q17	1013	845	525	525
q18	7038	5960	5773	5773
q19	1371	1011	617	617
q20	501	493	402	402
q21	2598	1871	1782	1782
q22	361	319	277	277
Total cold run time: 105958 ms
Total hot run time: 30745 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4470	4357	4354	4354
q2	263	340	252	252
q3	2126	2729	2250	2250
q4	1379	1803	1326	1326
q5	4334	4262	4321	4262
q6	232	182	139	139
q7	1929	2197	1934	1934
q8	2660	2438	2649	2438
q9	7690	7615	7753	7615
q10	2905	3138	2704	2704
q11	549	483	486	483
q12	717	739	613	613
q13	3821	4437	3522	3522
q14	296	317	297	297
q15	843	812	824	812
q16	682	742	722	722
q17	1174	1327	1384	1327
q18	8604	7957	8254	7957
q19	922	870	855	855
q20	2078	2144	1983	1983
q21	4768	4353	4221	4221
q22	560	561	532	532
Total cold run time: 53002 ms
Total hot run time: 50598 ms

@doris-robot
Copy link

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

query1	0.05	0.05	0.05
query2	0.13	0.07	0.07
query3	0.32	0.08	0.07
query4	1.60	0.10	0.10
query5	0.26	0.25	0.27
query6	1.15	0.65	0.64
query7	0.03	0.03	0.02
query8	0.07	0.06	0.06
query9	0.60	0.51	0.51
query10	0.55	0.56	0.56
query11	0.26	0.13	0.14
query12	0.27	0.15	0.14
query13	0.63	0.62	0.61
query14	0.99	0.99	0.98
query15	0.93	0.82	0.83
query16	0.39	0.40	0.43
query17	1.06	0.99	1.05
query18	0.25	0.23	0.23
query19	1.98	1.90	1.81
query20	0.02	0.01	0.01
query21	15.40	0.34	0.28
query22	4.97	0.11	0.12
query23	15.34	0.44	0.28
query24	2.30	0.56	0.37
query25	0.11	0.12	0.11
query26	0.19	0.18	0.18
query27	0.11	0.11	0.10
query28	3.36	1.15	0.98
query29	12.53	4.10	3.30
query30	0.32	0.13	0.11
query31	2.79	0.69	0.45
query32	3.23	0.62	0.50
query33	3.09	3.17	3.08
query34	16.41	5.06	4.54
query35	4.43	4.44	4.53
query36	0.62	0.50	0.51
query37	0.30	0.10	0.09
query38	0.26	0.06	0.05
query39	0.07	0.05	0.05
query40	0.21	0.16	0.17
query41	0.13	0.07	0.07
query42	0.09	0.05	0.05
query43	0.07	0.06	0.05
Total cold run time: 97.87 s
Total hot run time: 28.3 s

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 3.57% (1/28) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.63% (19422/36902)
Line Coverage 36.14% (180701/499996)
Region Coverage 32.47% (140052/431289)
Branch Coverage 33.49% (60655/181105)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 3.57% (1/28) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.24% (26486/36163)
Line Coverage 56.33% (280969/498772)
Region Coverage 54.05% (235465/435673)
Branch Coverage 55.71% (101282/181813)

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 66.67% (16/24) 🎉
Increment coverage report
Complete coverage report

@wenzhenghu
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	16497	4547	4310	4310
q2	2036	345	243	243
q3	9742	1284	728	728
q4	9852	755	307	307
q5	7480	2112	1954	1954
q6	190	177	145	145
q7	926	758	595	595
q8	9154	1354	1107	1107
q9	4558	4656	4615	4615
q10	6774	1930	1516	1516
q11	528	300	291	291
q12	334	370	220	220
q13	17568	4018	3252	3252
q14	227	229	214	214
q15	860	822	814	814
q16	671	680	611	611
q17	690	868	469	469
q18	6594	5887	5563	5563
q19	1115	1222	735	735
q20	544	579	429	429
q21	2763	1934	1960	1934
q22	395	326	294	294
Total cold run time: 99498 ms
Total hot run time: 30346 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4687	4555	4698	4555
q2	262	353	268	268
q3	2326	2969	2538	2538
q4	1519	1851	1391	1391
q5	4559	4464	4818	4464
q6	218	198	142	142
q7	1920	1880	1749	1749
q8	2581	2476	2446	2446
q9	7415	7315	7608	7315
q10	2738	2997	2549	2549
q11	573	458	454	454
q12	675	797	642	642
q13	3757	3965	3184	3184
q14	265	287	277	277
q15	827	784	769	769
q16	626	676	646	646
q17	1097	1312	1344	1312
q18	7403	7247	7306	7247
q19	794	783	793	783
q20	1921	2011	1901	1901
q21	4575	4143	4074	4074
q22	564	541	511	511
Total cold run time: 51302 ms
Total hot run time: 49217 ms

@doris-robot
Copy link

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

query1	0.06	0.05	0.05
query2	0.14	0.07	0.07
query3	0.31	0.08	0.08
query4	1.61	0.10	0.10
query5	0.27	0.25	0.25
query6	1.14	0.65	0.63
query7	0.03	0.03	0.03
query8	0.07	0.06	0.06
query9	0.59	0.49	0.49
query10	0.53	0.54	0.56
query11	0.26	0.14	0.13
query12	0.26	0.14	0.14
query13	0.63	0.62	0.60
query14	0.98	0.97	0.98
query15	0.91	0.82	0.81
query16	0.42	0.39	0.41
query17	1.05	1.04	1.05
query18	0.24	0.22	0.23
query19	1.97	1.80	1.78
query20	0.03	0.02	0.02
query21	15.39	0.34	0.30
query22	4.98	0.11	0.12
query23	15.37	0.44	0.28
query24	2.23	0.57	0.43
query25	0.11	0.11	0.11
query26	0.19	0.18	0.19
query27	0.10	0.10	0.11
query28	3.81	1.15	0.98
query29	12.53	4.04	3.29
query30	0.32	0.14	0.11
query31	2.79	0.69	0.45
query32	3.23	0.63	0.51
query33	3.01	3.06	3.14
query34	15.95	5.07	4.43
query35	4.44	4.55	4.52
query36	0.62	0.50	0.49
query37	0.31	0.09	0.08
query38	0.26	0.06	0.05
query39	0.08	0.05	0.05
query40	0.21	0.18	0.16
query41	0.13	0.07	0.07
query42	0.08	0.05	0.06
query43	0.07	0.05	0.06
Total cold run time: 97.71 s
Total hot run time: 28.26 s

@hello-stephen
Copy link
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 79.29% (1792/2260)
Line Coverage 64.75% (31831/49158)
Region Coverage 65.43% (15886/24280)
Branch Coverage 55.95% (8436/15078)

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 29.17% (7/24) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 3.57% (1/28) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.60% (19409/36902)
Line Coverage 36.12% (180580/499998)
Region Coverage 32.46% (139984/431289)
Branch Coverage 33.47% (60615/181105)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 21.43% (6/28) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.63% (25904/36163)
Line Coverage 54.29% (270787/498774)
Region Coverage 51.73% (225363/435673)
Branch Coverage 53.19% (96698/181813)

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 66.67% (16/24) 🎉
Increment coverage report
Complete coverage report

params.setLocalParams(Lists.newArrayList());
params.setWorkloadGroups(coordinatorContext.getWorkloadGroups());

if (connectContext != null && connectContext.getCurrentUserIdentity() != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

除了查询之外,streamload 以及insert into select 这里的设置也会起作用吗?


[[nodiscard]] int get_fragment_id() const { return _fragment_id; }

RuntimeState* get_runtime_state() { return _runtime_state.get(); }
Copy link
Contributor

Choose a reason for hiding this comment

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

这个方法有用?

}
if (BE_METRIC_SET.contains(cond.getMetricType())) {
containsBeMetric = true;
boolean isFe = FE_METRIC_SET.contains(cond.getMetricType());
Copy link
Contributor

Choose a reason for hiding this comment

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

这里是为了改啥?

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