Skip to content

Add fallback cluster config option - #193

Open
jakubpliszka wants to merge 1 commit into
masterfrom
jakubpliszka/fallback-cluster
Open

Add fallback cluster config option#193
jakubpliszka wants to merge 1 commit into
masterfrom
jakubpliszka/fallback-cluster

Conversation

@jakubpliszka

Copy link
Copy Markdown
Contributor

Adds optional Stores.MySQL.FallbackCluster to route checks for unconfigured MySQL cluster names to a configured fallback. Only /check and /check-read use the fallback. Exact configured names always take precedence, *-if-exists keeps 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.

Copilot AI balanced review requested due to automatic review settings September 7, 2026 12:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants