Uh oh!
There was an error while loading. Please reload this page.
[enhancement](workload policy) Add username-based backend workload policy support - #60559
Conversation
support workload policy base on username
Removed unused import statement for DebugUtil.
Thearas
commented
Feb 6, 2026
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
wenzhenghu
commented
Feb 6, 2026
run buildall |
doris-robot
commented
Feb 6, 2026
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
doris-robot
commented
Feb 6, 2026
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
wenzhenghu
commented
Feb 6, 2026
run buildall |
hello-stephen
commented
Feb 6, 2026
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Feb 6, 2026
FE UT Coverage ReportIncrement line coverage |
doris-robot
commented
Feb 6, 2026
TPC-H: Total hot run time: 30745 ms |
doris-robot
commented
Feb 6, 2026
ClickBench: Total hot run time: 28.3 s |
doris-robot
commented
Feb 6, 2026
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Feb 6, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Feb 6, 2026
FE Regression Coverage ReportIncrement line coverage |
wenzhenghu
commented
Feb 6, 2026
run buildall |
doris-robot
commented
Feb 6, 2026
TPC-H: Total hot run time: 30346 ms |
doris-robot
commented
Feb 6, 2026
ClickBench: Total hot run time: 28.26 s |
hello-stephen
commented
Feb 6, 2026
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Feb 6, 2026
FE UT Coverage ReportIncrement line coverage |
hello-stephen
commented
Feb 6, 2026
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Jun 6, 2026
FE Regression Coverage ReportIncrement line coverage |
yiguolei
commented
Jun 11, 2026
/review |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
There was a problem hiding this comment.
Requesting changes for one blocking test issue in the added regression coverage, plus a formatting failure.
Critical checkpoint conclusions:
- Goal/test proof: the FE and BE code paths mostly implement USERNAME as a shared workload-policy metric, but the added regression test does not prove the new BE-side behavior because it never lets
query_time > 1000match. - Scope/focus: implementation is focused on workload-policy validation, FE-to-BE resource info propagation, BE policy evaluation, and tests.
- Concurrency/lifecycle: no new locks or long lock-held work found; BE scheduler reads user metadata after QueryContext creation, with no additional lifecycle issue found.
- Configuration: no new configuration items.
- Compatibility/parallel paths: legacy Coordinator, Nereids
ThriftPlansBuilder, stream-load/routine-load/group-commit planning, and simplified fragment send paths were reviewed; no additional missing propagation path found beyond the unproven regression coverage. - FE-BE variable passing:
resource_infoalready exists and is now populated on the main fragment-building paths; BE consumes it into QueryContext. - Tests/results: BE/FE unit coverage was added, but end-to-end regression coverage is insufficient, and
git diff --checkreports trailing whitespace in the added groovy block. - Observability: cancel messages include the matched condition values; no additional observability blocker found.
- Transaction/persistence/data writes: policy persistence/replay continues through the existing edit-log/Gson path; no transaction or storage-format issue found.
- Security/threat model: SECURITY.md and threat-model.md were read because the change involves user identity metadata; no separate security finding is raised.
- User focus: no additional user-provided review focus was present.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
wenzhenghu
commented
Jun 11, 2026
run buildall |
hello-stephen
commented
Jun 11, 2026
TPC-H: Total hot run time: 29566 ms |
hello-stephen
commented
Jun 11, 2026
TPC-DS: Total hot run time: 168971 ms |
hello-stephen
commented
Jun 11, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Jun 11, 2026
FE Regression Coverage ReportIncrement line coverage |
yiguolei
commented
Jun 14, 2026
/review |
There was a problem hiding this comment.
Review result: request changes.
Critical checkpoint conclusions:
- Goal: Partially achieved. The PR wires USERNAME into BE workload-policy evaluation and updates the main FE-to-BE planning paths, but two validation/lifecycle issues can make policies match more broadly than intended.
- Scope: Mostly focused on workload policy plumbing and tests.
- Concurrency/lifecycle: No new lock order or thread-safety issue found in the runtime path; the blocking issue is replay lifecycle for previously persisted policies.
- Config / compatibility: No config added. Thrift enum is appended; the main compatibility concern is FE edit-log/image replay with old username policies.
- Parallel code paths: Legacy Coordinator, Nereids query, and Nereids stream-load paths now set resourceInfo. Existing review threads already covered earlier missing paths.
- Tests: Unit/regression coverage was added and git diff --check is clean, but tests are missing for replaying old invalid username policies and for conditionless FE-action policy creation.
- Data/transaction correctness: No data write or transaction visibility path is changed.
- Observability: Existing cancel messages include condition details; no additional observability blocker found.
User focus: no additional user-provided review focus was supplied.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…licy support (#60559) ### What problem does this PR solve? Problem Summary: Before this change, `username` was only treated as an FE-side workload schedule metric. This made it impossible to create or execute workload policies that combine `username` with BE-side metrics such as `query_time`, `be_scan_rows`, `be_scan_bytes`, or `query_be_memory_bytes`. This PR makes `username` a shared workload schedule metric that can be evaluated on both FE and BE: - Add `USERNAME` to `TWorkloadMetricType` so BE policies can receive username conditions. - Pass user metadata from FE fragment params to BE query context for normal query planning and Nereids stream load planning. - Expose user metadata through `TaskController` / `QueryTaskController`. - Add BE-side `WorkloadConditionUsername` evaluation. - Allow FE policy validation to distinguish FE-only metrics, BE-only metrics, and shared metrics. - Keep invalid username conditions rejected, including unsupported operators and blank usernames. - Add unit tests and regression coverage for creating policies with `username` plus BE metrics. ### Release note Support using `username` together with BE-side workload schedule metrics in workload policies. ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [x] Regression test - [x] Unit Test - [x] 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 <!-- Add your reason? --> - Behavior changed: - [x] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [x] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
What problem does this PR solve?
Problem Summary:
Before this change,
usernamewas only treated as an FE-side workload schedule metric. This made it impossible to create or execute workload policies that combineusernamewith BE-side metrics such asquery_time,be_scan_rows,be_scan_bytes, orquery_be_memory_bytes.This PR makes
usernamea shared workload schedule metric that can be evaluated on both FE and BE:USERNAMEtoTWorkloadMetricTypeso BE policies can receive username conditions.TaskController/QueryTaskController.WorkloadConditionUsernameevaluation.usernameplus BE metrics.Release note
Support using
usernametogether with BE-side workload schedule metrics in workload policies.Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)