Add fallback cluster config option - #193
Open
jakubpliszka wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The reviewed changes have no unresolved approval-blocking issues.
Review tier: Balanced
Findings: None
What changed in this PR
Adds an optional MySQL fallback cluster for unknown cluster names while preserving endpoint, metrics, and configured-name behavior.
Changes:
- Adds and validates
FallbackCluster. - Implements fallback resolution for standard checks.
- Prevents shared HTTP state mutations.
- Adds tests and documentation.
| File | Description |
|---|---|
pkg/throttle/throttler_test.go |
Tests fallback precedence and throttling state. |
pkg/throttle/check.go |
Implements fallback resolution and requested-name metrics. |
pkg/throttle/api_fallback_test.go |
Tests fallback behavior across HTTP endpoints. |
pkg/http/api.go |
Uses request-local flags and results. |
pkg/config/mysql_config.go |
Adds and validates fallback configuration. |
pkg/config/config_test.go |
Tests fallback validation. |
doc/mysql.md |
Documents MySQL fallback configuration. |
doc/http.md |
Clarifies strict *-if-exists behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
UyumazHakan
approved these changes
Sep 7, 2026
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.
Adds optional
Stores.MySQL.FallbackClusterto route checks for unconfigured MySQL cluster names to a configured fallback. Only/checkand/check-readuse the fallback. Exact configured names always take precedence,*-if-existskeeps its existing behavior and invalid fallback targets are rejected during configuration loading.Throttling decisions use the resolved cluster, while request metrics retain the requested name. Scoped admin controls continue to target configured cluster names. Also avoids shared flag/result mutations in HTTP checks.