[Query Throttler] Add dry-run mode#18657
Merged
arthurschreiber merged 2 commits intovitessio:mainfrom Sep 22, 2025
Merged
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 <siddharth16396@gmail.com>
Contributor
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 <siddharth16396@gmail.com>
siddharth16396
commented
Sep 16, 2025
|
|
||
| // If dry-run mode is enabled, log the decision but don't throttle | ||
| if qt.cfg.DryRun { | ||
| log.Warningf("[DRY-RUN] %s", decision.Message) |
Contributor
Author
There was a problem hiding this comment.
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.
harshit-gangal
approved these changes
Sep 19, 2025
arthurschreiber
approved these changes
Sep 22, 2025
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.
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