Repository navigation
feat(allocation_policies): pardon rejections when dynamic allocation policy is on #8431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c593fde
feat(allocation_policies): pardon rejections when the cluster is idle
pbhandari ecffa7b
ref(allocation_policies): address idle-pardon review comments
pbhandari 5729ba1
ref(allocation_policies): fold idle check into QuotaAllowance.decision
pbhandari 27af733
ref(allocation_policies): getattr is_idle; space get_quota_allowance
pbhandari ac4654c
Simplify when we do and don't pardon allocation policies
pbhandari d464149
Fix tests post rebase
pbhandari 264d4bd
ref(allocation_policies): move LoadInfo out of snuba.web.rpc
pbhandari a407e06
ref(allocation_policies): match on QuotaAllowanceDecision
pbhandari 696639a
ref(allocation_policies): read is_pardonable from config like is_enfo…
pbhandari 155432b
ref(allocation_policies): rename LoadInfo.is_idle to should_pardon
pbhandari a03c742
Fix allocation-policy tests broken by is_pardonable config
pbhandari 77075b5
Fix test_simple_config_values for is_pardonable config
pbhandari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: A query pardoned after being rejected by
BytesScannedRejectingPolicyincorrectly retainsis_throttled=True, causing successful queries to be logged and metriced as throttled.Severity: LOW
Suggested Fix
When creating a new
QuotaAllowancefor aPARDONEDdecision within theget_quota_allowancefunction, explicitly setis_throttled=False. This will ensure that pardoned queries are correctly logged and not marked as throttled.Prompt for AI Agent
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this finding. I don't understand why we set
can_run=Falsewhile also setting throttling parameters, but it means that we could be pardoning a request with throttled settings:snuba/snuba/query/allocation_policies/bytes_scanned_rejecting_policy.py
Lines 366 to 376 in 6f90059
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah; I'm fixing throttling later. It's existing logic >.> and I want to get us to a point where we can start iterating on the dynamism so we start enabling Allocation Policies (and hopefully deal with some of the issues that keep cropping up due to us not having any way to load shed)