server: add admission control for tenant startup wait queue#171225
Open
shankeleven wants to merge 2 commits into
Open
server: add admission control for tenant startup wait queue#171225shankeleven wants to merge 2 commits into
shankeleven wants to merge 2 commits into
Conversation
When a SQL connection arrives for a default virtual cluster whose tenant server is still initializing, the server controller may wait for the tenant server to become available before accepting the connection. Previously, an unbounded number of connections could wait concurrently, allowing a bootstrapping tenant to consume excessive resources through open TCP connections. Add admission control to limit the number of concurrent waiters and reject excess connections immediately. Introduce metrics for wait queue observability, rate-limit timeout/rejection logs, and improve client errors to encourage retry. Also clarify documentation around DataStateReady and tenant runtime readiness. Relates to: cockroachdb#154857 Release note (ops change): Added cluster setting `server.controller.mux_virtual_cluster_wait.max_concurrent` (default 10) to limit the number of SQL connections that may wait concurrently for a default virtual cluster to become available. Connections above the limit are rejected immediately. Added metrics under `server.controller.mux_virtual_cluster_wait.*` for wait queue observability.
Contributor
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Member
|
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
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.
fixes #154857
When a SQL connection arrives for a default virtual cluster whose tenant server is still initializing, the server controller may wait for the tenant server to become available before accepting the connection.
Previously, an unbounded number of connections could wait concurrently, allowing a bootstrapping tenant to consume excessive resources through open TCP connections.
Add admission control to limit the number of concurrent waiters and reject excess connections immediately. Introduce metrics for wait queue observability, rate-limit timeout/rejection logs, and improve client errors to encourage retry. Also clarify documentation around DataStateReady and tenant runtime readiness.
Release note (ops change): Added cluster setting
server.controller.mux_virtual_cluster_wait.max_concurrent(default 10) to limit the number of SQL connections that may wait concurrently for a default virtual cluster to become available. Connections above the limit are rejected immediately. Added metrics underserver.controller.mux_virtual_cluster_wait.*for wait queue observability.