cockroachdb / cockroach

CockroachDB - the open source, cloud-native distributed SQL database.
https://www.cockroachlabs.com
Other
29.58k stars 3.71k forks source link

API For Requesting Sql Server Instances #77332

Open JeffSwenson opened 2 years ago

JeffSwenson commented 2 years ago

There were discussions in the multi-tenant meeting related to allowing cockroachdb to request additional sql servers from the Serverless control plane. The API may be helpful in the following scenarios:

There is precedent in the DB for such an API.

From the standpoint of the serverless team, reactive scaling is preferable to the DB requesting pods. The operator is able to make decisions based on historical load and the total capacity available in the cluster. Just because a query can take advantage of 20 pods does not mean it should get 20 pods.

cc: @andy-kimball @ajstorm

Jira issue: CRDB-13530

andy-kimball commented 2 years ago

My thinking was that we'd expand the tenant directory API, and run a sidecar process on every SQL pod. The API would have one or more extra methods that would allow the SQL pod to request CPU capacity in other regions. I think it would be OK if the request contained a hint of what the running operation thinks it needs, in terms of CPU. For example, an Import job might request 20 vCPUs worth of capacity in us-east-1. This would only be a request, though; it might only get some subset of the requested amount.

ajstorm commented 2 years ago

Thanks for opening this @JeffSwenson. This issue will also influence how we design multi-region for Serverless so I've added this to the multi-region board. The request makes sense on the bulk side, but for multi-region we'll need a SQL server pod in that region to accept any DistSQL request for the given tenant (or performance will be impacted). That may imply that when we startup a tenant in a multi-region cluster, we need pods in each region, but that seems wasteful, and so spinning them up as required would be preferable.

github-actions[bot] commented 10 months ago

We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!