-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: connecting to an inactive tenant should return an error #83650
Description
Context: https://cockroachlabs.slack.com/archives/C02HWA24541/p1656595977592689
For the purposes of streaming replication, we want to create a tenant in an inactive state such that during the entire replication process one is unable to query the state of the tenant. This way the potentially-inconsistent state as we stream SSTables over is not observable until we explicitly revert to a single Cutover timestamp that leaves the tenant's tables in a consistent state and we call sql.ActivateTenant afterwards.
At the moment #83646 creates a tenant with the descpb.TenantInfo_ADD state and calls ActivateTenant afterwards, however we are still able to open up a db connection and execute SQL queries as the tenant during the replication process.
Jira issue: CRDB-17187
Epic CRDB-26691