-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: TRUNCATE unable to preserve split point when run from a tenant #82944
Description
Describe the problem
Internally TRUNCATE works by dropping all indexes from the table then creating new indexes with new IDs.
If the user had run SPLIT before on the table, TRUNCATE contains code to extract the split points pre-DROP, then apply them again post-CREATE.
All this code is currently disabled under multitenancy.
This is a problem as we want to continue to preserve split point in CC Dedicated with multi-tenancy enabled.
Expected behavior
The TRUNCATE code unconditionally runs a KV request through the KV connector to "extract the split points" from an existing table (key range) pre-DROP, then sends another request to "apply the split points" post-CREATE.
This code runs regardless of the privilege level of the tenant. In non-privileged tenants, the "extract" operation would return the empty set so there is nothing to apply.
Jira issue: CRDB-16747
Epic CRDB-16746