cockroachdb / cockroachdb/cockroach
server: synchronize the various rangefeeds on tenant records
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
**Describe the problem**
Noticed while fixing #96512:
```
CREATE TENANT foo
ALTER TENANT foo SET CLUSTER SETTING
ALTER TENANT foo START SERVICE
```
It's not guaranteed that the change to the cluster setting override has been observed by its rangefeed before the service mode change has been recognized by its own (separate) rangefeed. So it's possible for the server to start with stale/incomplete knowledge of its setting overrides.
This problem will be further amplified when we work to pump tenant tasks towards the tenant server (so that tasks are run/initialized prior to opening up SQL service to clients.)
**Expected behavior**
We need to set up a single rangefeed across all the 3 tables:
- `system.tenants`
- `system.tenant_settings`
- `system.tenant_tasks` (or whatever the table is called)
And use a single watcher to gather all the tenant metadata in one place.
This way whenever we observe the last update to the tenant table we know that the updates to the other tables have been observed as well.
Epic: CRDB-26691
Jira issue: CRDB-29153
Contributor guide
Assessment
This issue has not been assessed yet.