-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[Query Throttler] Add dry-run mode #18657
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
[Query Throttler] Add dry-run mode #18657
Conversation
Summary: Implements a dry-run mode for the Query Throttler that allows observing throttling decisions without actually blocking queries. Background: - Query throttling is critical for database performance but can be risky when first deployed - Operators need visibility into throttling behavior before enabling actual query blocking - Testing throttling logic in production environments requires non-disruptive monitoring Solution: - Add DryRun boolean field to Config struct for controlling dry-runbehavior - When dry-run is enabled, throttling decisions are logged as warnings but queries proceed normally - Maintains full compatibility with existing throttling logic and strategies - Added comprehensive test coverage for all dry-run scenarios including disabled throttler, normal mode, and dry-run mode combinations Test Plan: - Added unit tests covering all dry-run mode scenarios in TestIncomingQueryThrottler_DryRunMode - Tests verify proper logging behavior and query execution flow - Existing query throttler tests continue to pass ensuring no regression Signed-off-by: siddharth16396 <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18657 +/- ##
==========================================
- Coverage 67.53% 67.53% -0.01%
==========================================
Files 1613 1613
Lines 263780 263784 +4
==========================================
- Hits 178144 178141 -3
- Misses 85636 85643 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: siddharth16396 <[email protected]>
|
|
||
| // If dry-run mode is enabled, log the decision but don't throttle | ||
| if qt.cfg.DryRun { | ||
| log.Warningf("[DRY-RUN] %s", decision.Message) |
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.
We will soon be adding support for "metrics" in throttler, where we will be emitting a metric for this as well.
But that is expected later on.
Description
This PR introduces option for having a "Dry Run Mode" in the Query Throttler system for Vitess tablets outlined in RFC #18412 , First PR :#18449
In this PR we are Implements a dry-run mode for the Query Throttler that allows observing throttling decisions without actually blocking queries.
Background:
Solution:
Test Plan:
Checklist