Repository navigation
feat(allocation): dynamically enforce allocation policies via load thresholds - #8527
Merged
pbhandari merged 2 commits intoOct 8, 2026
Conversation
pbhandari
force-pushed
the
prajjwalbhandari/eap-831-dynamically-enforce-allocation-policies
branch
7 times, most recently
from
October 8, 2026 19:39
8dd1ba8 to
ecef84b
Compare
pbhandari
marked this pull request as ready for review
October 8, 2026 19:40
pbhandari
commented
Oct 8, 2026
Comment on lines
+409
to
+414
| "cluster_load": { "type": "number", "optional": true }, | ||
| "concurrent_queries": { "type": "number", "optional": true }, | ||
| "cgroup_user_time_normalized": { "type": "number", "optional": true }, | ||
| "disk_inflight_ops": { "type": "number", "optional": true }, | ||
| "memory_allocated": { "type": "number", "optional": true }, | ||
| "part_mutation": { "type": "number", "optional": true } |
Contributor
Author
There was a problem hiding this comment.
I don't need all these signals. But this is fine as a temp measure while we figure out what signals to monitor.
pbhandari
force-pushed
the
prajjwalbhandari/eap-831-dynamically-enforce-allocation-policies
branch
from
October 8, 2026 20:04
ecef84b to
b1f9212
Compare
ElioDiNino
approved these changes
Oct 8, 2026
pbhandari
deleted the
prajjwalbhandari/eap-831-dynamically-enforce-allocation-policies
branch
October 8, 2026 23:53
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes EAP-831.
Replaces the two
storage_routingboolean flags with per-policy load thresholds that gate dynamic pardoning.Changes (one commit each)
storage_routing.enable_get_cluster_loadinfo(option + schema key + the gates inget_cluster_loadinfoanddb_query); load info is now fetched unconditionally so dynamism is always configurable.thresholdskey to theallocation_policiesconfig (sibling ofpolicies/match/remove). The resolver copies the block's thresholds onto every policy it constructs, so each policy owns itsreject/throttleceilings at runtime. Keys are enumerated insentry-options/schemas/snuba/schema.json, and a test asserts those keys are a subset ofLoadInfo's dataclass fields.storage_routing.enable_dynamic_allocation_policy.LoadInfo.should_pardon()is replaced byLoadInfo.exceeds(thresholds), and the pardon path inQuotaAllowance.decisionnow pardons a rejection only when the policy is pardonable, load info exists, reject thresholds are configured, and the cluster is below all of them. No thresholds / missing load info means keep rejecting.Config shape:
is_enforced / is_pardonable
is_enforced=False-> dynamism skipped; policy always passes through (existing short-circuit).is_enforced=True+ no thresholds -> always enforced (never pardoned).is_pardonableis unchanged — still the per-policy toggle for participating in dynamic pardoning.Out of scope
_get_cluster_loadinforeturnsLoadInfo()with all-1s, which compares below any threshold and would wrongly pardon. Fail-safe handling of that case is deferred.thresholds.throttleinto throttling decisions (the helper supports it; consumption comes later).Tests
tests/query/allocation_policies/test_thresholds_schema.py(new): schema threshold keys subset ofLoadInfofields.LoadInfo.exceedsunit tests.test_allocation_policy_base,test_db_query,test_storage_routing,test_cluster_loadinfo) to the thresholds API.