cockroachdb / cockroachdb/cockroach

kv,sql: add new KV endpoint that prepares split points and scatters ranges during RESTORE

Open
#99,772 3 comments 0 reactions 0 assignees View on GitHub
A-kv A-multitenancy C-enhancement T-kv
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

The current implementation of RESTORE needs to know about node/store boundaries and issue manual AdminSplit and AdminScatter requests to obtain good performance on the resulting tables.

In a multi-tenant environment (especially CC Serverless where we architecturally do not trust SQL servers), providing routine access to node/store details and especially the KV AdminSplit/AdminScatter constitutes a security risk – a malicious tenant server could use these KV commands to disrupt the storage layer for all tenants.

With the goal of disallowing AdminSplit/AdminScatter in every secondary tenant by default, we need a new KV command that “prepares” the target keyspace prior to the AddSST calls by RESTORE.

The KV Command could take as argument:
- the key spans being restored
- an estimate of the data size
- optionally, expected locality/zcfg of the target data

And would internally issue split points and scatter commands that will spread this data ahead of the RESTORE.

Epic: CRDB-26067

Jira issue: CRDB-26068

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.