Uh oh!
There was an error while loading. Please reload this page.
branch-4.1: [enhancement](workload policy) Add username-based backend workload policy support #60559 - #64493
Conversation
…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 -->
hello-stephen
commented
Jun 15, 2026
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
hello-stephen
commented
Jun 15, 2026
run buildall |
hello-stephen
commented
Jun 15, 2026
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Jun 15, 2026
FE UT Coverage ReportIncrement line coverage |
hello-stephen
commented
Jun 15, 2026
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Jun 15, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Jun 15, 2026
FE Regression Coverage ReportIncrement line coverage |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
Cherry-picked from #60559