-
Notifications
You must be signed in to change notification settings - Fork 4.1k
kvobs: support a SHOW REPLICAS command #84090
Description
Today, it's difficult for SQL-level developers to determine where replicas exist for each of their databases/tables/indexes/row spans. They want to know how many replicas exist and where those replicas are placed. They want to understand which replicas can always serve consistent reads (i.e. the leaseholder replica), which replicas can usually serve consistent reads (i.e. any replica in the case of a GLOBAL table), and which replicas can only serve stale reads. They want to understand which replicas are used for writes (i.e. voting replicas). These concerns are especially important for any developer building a multi-region app.
To get this information today, developers need to drop down to the SHOW RANGES command, which is problematic:
- It references concepts like nodes and stores, which are lower-level KV concepts that only operators concern themselves with.
- It references concepts like ranges, which are higher-level than nodes and stores, but still unfamiliar to an average SQL developer.
- SHOW RANGES is not supported in CRDB Serverless.
I'd suggest CRDB exposes a new SHOW REPLICAS command, which shows information that's very similar to what SHOW RANGES shows today, except that it's expressed in terms of databases/tables/indexes/row spans rather than nodes/stores/ranges. The name is TBD, SHOW REPLICAS is just a suggestion. In addition, the columns we return would need to be carefully considered so that they make sense to SQL developers who need to care about the location of their data.
Jira issue: CRDB-17456