cockroachdb / cockroachdb/cockroach
server: system tenant should be able to query which app tenants can serve sql
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
The data_state `ready` does not imply the tenant is ready to serve queries, contrary to popular (at least my) belief. The `ready` state simply allows the tenant to run bootstrap.
After the tenant has completed bootstrap, i we could consider adding a new data_state, `online`. Note, even after the tenant completes bootstrap, each individual sql server on each node needs to complete setup. So, adding a new `online` mode may not solve the problem completely.
It is also worth noting that if the user is attempting to connect to the default tenant in service mode shared or external (i.e. not none), we will hold open the user's connection to the cluster and wait for server startup to complete [here](https://github.com/msbutler/cockroach/blob/master/pkg/server/server_controller_sql.go#L120) for up to 10 seconds by default. This strategy is also imperfect as it is vulnerable to DOS attacks-- since we are holding open a tcp connection, somebody could open a bunch of these connections to a bootstrapping tenant.
I'm writing up this issue as bootstrap for read from standby tenants for PCR is significantly longer than a vanilla application tenant, since it currently needs to ingest the whole catalog during bootstrap. Given that we're considering throwing away the current reader tenant design, I don't think we need to address this current issue now. I've written it up just so we have this in our minds when we eventually refactor tenant server startup (relates to https://github.com/cockroachdb/cockroach/issues/153880, and slack[ thread](https://cockroachlabs.slack.com/archives/C07T05244KZ/p1759240689131279?thread_ts=1758304678.161739&cid=C07T05244KZ)).
Jira issue: CRDB-55169
Contributor guide
Assessment
This issue has not been assessed yet.