cockroachdb / cockroachdb/cockroach
Locality-Aware Backups not respecting the --locality settings on startup
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
The documentation indicates that we need to specify the --locality settings when creating locality-aware backups: [Docs: Locality Aware Backups](https://www.cockroachlabs.com/docs/stable/take-and-restore-locality-aware-backups.html)
Problem is that the SQL syntax only needs the "region" portion of the locality, not the complete hierarchy.
For example:
```
CREATE SCHEDULE core_schedule_label
FOR BACKUP INTO (
's3://zlamal-east-bucket/default?COCKROACH_LOCALITY=default',
's3://zlamal-east-bucket/zone-1?COCKROACH_LOCALITY=region%3DUS-East%2Czone%3DZone-1',
's3://zlamal-east-bucket/zone-2?COCKROACH_LOCALITY=region%3DUS-East%2Czone%3DZone-2')
RECURRING '@daily'
WITH SCHEDULE OPTIONS first_run = 'now';
```
results in:
> ERROR: failed to parse backup locality: tier must be in the form "key=value" not "region=US-East,zone=Zone-1"
While it makes sense to only focus at the highest level in the hierarchy (eg region-level), backups are driven at the node-level and should allow for highest-level regionality and/or the option to choose the entire regionality hierarchy. This will allow for better automation that can be tied to nodes, and also align with the documentation.
Full Slack discussion:
[https://cockroachlabs.slack.com/archives/C2C5FKPPB/p1676039571874239](https://cockroachlabs.slack.com/archives/C2C5FKPPB/p1676039571874239)
CRDB 22.2.2
Jira issue: CRDB-24428
Contributor guide
Assessment
This issue has not been assessed yet.