Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[fix](workload policy)Remove set session variable workload policy action#64856

Open
feiniaofeiafei wants to merge 5 commits into
apache:masterfrom
feiniaofeiafei:remove-work-load-policy-set-var
Open

[fix](workload policy)Remove set session variable workload policy action#64856
feiniaofeiafei wants to merge 5 commits into
apache:masterfrom
feiniaofeiafei:remove-work-load-policy-set-var

Conversation

@feiniaofeiafei

@feiniaofeiafei feiniaofeiafei commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Related PR: #28443

Problem Summary: The workload policy set_session_variable action has problematic behavior and is being removed. This change removes its
parser special case, runtime action implementation, and action type registration, then updates workload policy tests so new policies reject set_session_variable as an invalid action. Existing BE-side workload policy actions remain unchanged.

Release note

The set_session_variable workload policy action is no longer supported.

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

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: The workload policy set_session_variable action has problematic behavior and is being removed. This change removes its parser special case, runtime action implementation, and action type registration, then updates workload policy tests so new policies reject set_session_variable as an invalid action. Existing BE-side workload policy actions remain unchanged.

### Release note

The set_session_variable workload policy action is no longer supported.

### Check List (For Author)

- Test:
    - Unit Test: ./run-fe-ut.sh --run org.apache.doris.resource.workloadschedpolicy.WorkloadSchedPolicyMgrTest (passed; rerun with elevated permissions after Mockito inline attach failed under sandbox)
    - Checkstyle: mvn checkstyle:check -pl fe-core,fe-sql-parser (passed)
    - Regression test: ./run-regression-test.sh --run -d workload_manager_p0 -s test_workload_sched_policy (attempted, failed because local 127.0.0.1:9030 Doris cluster was not running)
- Behavior changed: Yes. set_session_variable workload policy action is rejected.
- Does this need documentation: No
@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?

yiguolei
yiguolei previously approved these changes Jun 25, 2026
@yiguolei

Copy link
Copy Markdown
Contributor

Please also remove the document from master and 4.x

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

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@github-actions github-actions Bot removed the approved Indicates a PR has been approved by one committer. label Jun 25, 2026
@feiniaofeiafei

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17676	4026	4019	4019
q2	2061	332	195	195
q3	10301	1456	817	817
q4	4705	463	335	335
q5	7600	874	588	588
q6	181	172	134	134
q7	762	844	631	631
q8	9327	1566	1651	1566
q9	5663	4501	4498	4498
q10	6771	1809	1538	1538
q11	452	274	251	251
q12	636	429	301	301
q13	18108	3339	2771	2771
q14	276	262	238	238
q15	q16	800	773	710	710
q17	1023	1046	993	993
q18	7124	5856	5518	5518
q19	1305	1281	1061	1061
q20	501	405	266	266
q21	6342	2836	2499	2499
q22	468	374	319	319
Total cold run time: 102082 ms
Total hot run time: 29248 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	5149	4792	4758	4758
q2	335	368	245	245
q3	4932	5253	4758	4758
q4	2070	2139	1397	1397
q5	4859	4670	4632	4632
q6	227	175	132	132
q7	1934	1768	1524	1524
q8	2448	2084	2121	2084
q9	7926	7646	7533	7533
q10	4727	4645	4182	4182
q11	523	390	360	360
q12	731	745	521	521
q13	3053	3353	2796	2796
q14	272	284	260	260
q15	q16	683	715	606	606
q17	1292	1270	1271	1270
q18	7353	7022	6981	6981
q19	1172	1170	1126	1126
q20	2232	2257	1937	1937
q21	5253	4587	4384	4384
q22	522	479	412	412
Total cold run time: 57693 ms
Total hot run time: 51898 ms

@hello-stephen

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

query5	4306	648	486	486
query6	429	188	166	166
query7	4870	580	307	307
query8	337	199	172	172
query9	8765	4032	4009	4009
query10	439	324	263	263
query11	5987	2328	2161	2161
query12	167	103	103	103
query13	1252	585	430	430
query14	6294	5290	4925	4925
query14_1	4266	4244	4280	4244
query15	217	205	184	184
query16	1021	464	440	440
query17	1104	712	554	554
query18	2569	485	339	339
query19	214	183	148	148
query20	112	112	110	110
query21	215	137	117	117
query22	13694	13668	13434	13434
query23	17556	16567	16091	16091
query23_1	16229	16265	16212	16212
query24	7616	1834	1293	1293
query24_1	1350	1297	1294	1294
query25	554	486	417	417
query26	1302	335	174	174
query27	2609	544	357	357
query28	4417	2040	2005	2005
query29	1088	659	503	503
query30	309	238	207	207
query31	1142	1078	958	958
query32	109	63	61	61
query33	548	334	259	259
query34	1198	1154	694	694
query35	762	779	666	666
query36	1398	1381	1201	1201
query37	155	105	89	89
query38	1898	1724	1654	1654
query39	918	905	881	881
query39_1	863	859	879	859
query40	218	123	102	102
query41	64	64	61	61
query42	87	87	89	87
query43	320	323	282	282
query44	1510	776	779	776
query45	202	181	174	174
query46	1092	1242	744	744
query47	2329	2311	2240	2240
query48	405	406	300	300
query49	606	435	324	324
query50	1016	360	260	260
query51	4525	4427	4267	4267
query52	82	82	75	75
query53	261	286	191	191
query54	282	219	194	194
query55	74	69	67	67
query56	228	235	225	225
query57	1433	1412	1296	1296
query58	234	209	209	209
query59	1594	1653	1512	1512
query60	275	248	230	230
query61	146	142	148	142
query62	701	650	588	588
query63	239	196	185	185
query64	2514	764	601	601
query65	4896	4760	4804	4760
query66	1797	458	336	336
query67	28956	28854	28665	28665
query68	3277	1521	986	986
query69	418	306	273	273
query70	1092	978	965	965
query71	295	238	209	209
query72	2919	2642	2328	2328
query73	879	789	437	437
query74	5127	4963	4767	4767
query75	2620	2542	2167	2167
query76	2332	1279	811	811
query77	370	391	288	288
query78	12666	12557	11937	11937
query79	1257	1177	754	754
query80	553	482	373	373
query81	458	283	240	240
query82	244	160	125	125
query83	351	278	249	249
query84	270	145	109	109
query85	864	513	410	410
query86	323	296	286	286
query87	1844	1828	1780	1780
query88	3718	2767	2750	2750
query89	420	389	332	332
query90	2196	177	176	176
query91	167	161	133	133
query92	65	66	53	53
query93	1615	1598	865	865
query94	550	351	311	311
query95	680	454	343	343
query96	1083	816	340	340
query97	2686	2726	2560	2560
query98	216	203	202	202
query99	1176	1168	1033	1033
Total cold run time: 257472 ms
Total hot run time: 171186 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.10	0.05	0.05
query3	0.25	0.14	0.13
query4	1.62	0.13	0.13
query5	0.28	0.22	0.22
query6	1.24	1.10	1.05
query7	0.05	0.00	0.00
query8	0.06	0.04	0.04
query9	0.38	0.31	0.30
query10	0.57	0.54	0.55
query11	0.19	0.14	0.14
query12	0.19	0.14	0.15
query13	0.48	0.49	0.47
query14	1.02	1.02	1.01
query15	0.63	0.59	0.61
query16	0.32	0.32	0.32
query17	1.15	1.16	1.08
query18	0.21	0.20	0.21
query19	2.08	1.97	1.92
query20	0.01	0.01	0.01
query21	15.46	0.22	0.13
query22	4.85	0.05	0.05
query23	16.14	0.30	0.12
query24	3.16	0.43	0.34
query25	0.14	0.07	0.04
query26	1.01	0.21	0.15
query27	0.05	0.06	0.04
query28	3.60	0.98	0.56
query29	12.60	4.34	3.48
query30	0.28	0.15	0.15
query31	2.78	0.60	0.32
query32	3.22	0.60	0.49
query33	3.23	3.14	3.18
query34	15.66	4.20	3.55
query35	3.53	3.49	3.53
query36	0.57	0.45	0.44
query37	0.09	0.07	0.07
query38	0.06	0.03	0.04
query39	0.05	0.02	0.03
query40	0.19	0.17	0.14
query41	0.08	0.03	0.03
query42	0.04	0.02	0.02
query43	0.05	0.04	0.04
Total cold run time: 97.68 s
Total hot run time: 25.18 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 25.00% (3/12) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 3.93% (9/229) 🎉
Increment coverage report
Complete coverage report

@morrySnow

Copy link
Copy Markdown
Contributor

add related PR

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

Copy link
Copy Markdown
Contributor

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

@yiguolei

yiguolei commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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

Automated review summary for PR #64856 at head 4fc1b5e.

I reviewed all changed files and the relevant workload policy parser, validation, replay, publication, FE daemon, regression-test, and BE scheduler paths. I did not add new inline comments in this pass. The only substantiated concern found here is the stale legacy SET_SESSION_VARIABLE metadata behavior, and that is substantially covered by existing discussion r3473644035, which already requested upgrade compatibility handling and clearing the corresponding metadata.

Critical checkpoint conclusions:

  • Goal: The PR removes new set_session_variable workload policy support: the special parser branch is removed, new action construction rejects it, the runtime action class is deleted, and the FE workload scheduler daemon is no longer started.
  • Scope: The change is focused on workload policy action removal plus expected test-output updates.
  • Concurrency/lifecycle: Removing the FE daemon removes the periodic FE scan path; no new thread, lock ordering, or long-running lock behavior is introduced. Existing policy map locking remains the relevant guard.
  • Configuration: No new config is added. The removed FE daemon leaves no dynamic config behavior to validate in this patch.
  • Compatibility/persistence: SET_SESSION_VARIABLE remains in the enum so old JSON can deserialize, and gsonPostProcess() skips runtime action creation. The remaining metadata-clearance concern is duplicate-suppressed against existing discussion r3473644035 rather than repeated here.
  • FE/BE protocol and parallel paths: BE publication still maps only supported BE actions, and BE-side workload policy condition handling includes USERNAME, so username-plus-cancel policies can be published to BE. Policies containing the deprecated action are not published because ACTION_MAP has no deprecated mapping.
  • Tests: The regression and FE unit test changes cover new rejection of set_session_variable and the username-plus-BE-action policy path. I could not run FE/regression tests locally because thirdparty/installed and thirdparty/installed/bin/protoc are missing in this runner, and no Doris cluster is available.
  • Expected results: The changed .out file matches the removal of FE set_session_variable policies and replacement of alter-policy coverage with cancel_query.
  • Observability/performance: No new observability or hot-path work is introduced; the FE periodic scheduler path is removed.

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

Subagent conclusions:

  • optimizer-rewrite: no optimizer/rewrite, parser semantic-equivalence, join, or aggregate candidates in the initial pass or convergence.
  • tests-session-config: reported TSC-1 for stale legacy metadata after replay; main verification marked it duplicate_of_existing_thread for r3473644035, so no duplicate inline comment was submitted.
  • Convergence round 1 ended with both live subagents replying NO_NEW_VALUABLE_FINDINGS for the same ledger and empty proposed inline comment set.

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

Labels

approved Indicates a PR has been approved by one committer. dev/4.1.x reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants