Skip to content

Add throttle settings (throttle_attribute, node/shared throttle limit…#8

Open
LilyCaroline17 wants to merge 1 commit into
dzane17:3.7-wlm-throttlingfrom
LilyCaroline17:add-throttle-settings
Open

Add throttle settings (throttle_attribute, node/shared throttle limit…#8
LilyCaroline17 wants to merge 1 commit into
dzane17:3.7-wlm-throttlingfrom
LilyCaroline17:add-throttle-settings

Conversation

@LilyCaroline17

Copy link
Copy Markdown

Description

Adds throttle configuration fields to the WorkloadGroup construct as the foundational layer for WLM Request Throttling (# 21064). This PR introduces and persists the settings on the workload group construct.

Fields: Added 3 fields to the workload group construct

  • throttle_attribute — the dimension the limit is keyed by (e.g. principal.username). Optional; when omitted, the whole group is throttled as a single bucket.
  • node_throttle_limit — per-node in-flight allowance
  • shared_throttle_limit — additional central pool drawn on after a node exhausts its local allowance.

All three are optional. The total cluster-wide ceiling is node_throttle_limit × N + shared_throttle_limit.

Example

PUT _wlm/workload_group/
{
  "name": "analytics",
  "resiliency_mode": "enforced",
  "resource_limits": { "cpu": 0.3, "memory": 0.4 },
  "throttle_attribute": "principal.username",
  "node_throttle_limit": 10,
  "shared_throttle_limit": 20
}

Update / clear semantics

Throttle fields follow three-way merge semantics on update:

  • Field absent from the request → keep the existing value.
  • Field present with a value → overwrite.
  • Field present as explicit JSON null → clear the field (disable that dimension).
# To disable node-level throttling, keep the shared pool and attribute, can send:
PUT _wlm/workload_group/analytics
{ 
  "node_throttle_limit": null 
}
# Same logic applies to the shared_throttle_limit

Validation

  • Limits must be non-negative when set (node_throttle_limit / shared_throttle_limit).
  • throttle_attribute cannot be blank when set.
  • A group with throttle_attribute must have at least one limit (nothing to enforce otherwise).
  • If throttling is enabled, the effective ceiling (node ?? 0) + (shared ?? 0) must be ≥ 1 (a 0 ceiling would reject all requests).

throttle_attribute is currently stored as an opaque non-blank string; it is not yet validated against the WLM attribute registry (index_pattern, principal.username, principal.role). Will complete in a later PR

Testing

Added unit tests in WorkloadGroupTests. Manually verified end-to-end against a live single-node cluster (./gradlew :run -PinstalledPlugins="['workload-management']", WLM mode enabled): create, GET, merge-update, clear-via-null, and all four validation rejections behave as expected.

Related Issues

Resolves # 21064

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…s) to WorkloadGroup construct

Signed-off-by: Emily Guo <35637792+LilyCaroline17@users.noreply.github.com>
@dzane17 dzane17 closed this Jul 10, 2026
@dzane17 dzane17 reopened this Jul 10, 2026
@dzane17 dzane17 force-pushed the 3.7-wlm-throttling branch from 4ae1f72 to b6244e8 Compare July 10, 2026 17:16
@dzane17 dzane17 closed this Jul 10, 2026
@dzane17 dzane17 reopened this Jul 10, 2026
@dzane17 dzane17 force-pushed the 3.7-wlm-throttling branch from b6244e8 to a7bd18c Compare July 10, 2026 17:38
@dzane17 dzane17 closed this Jul 10, 2026
@dzane17 dzane17 reopened this Jul 10, 2026
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