cockroachdb / cockroachdb/cockroach
backup: enable timestamp chaining for old backup schedules
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
PTS timestamp chaining is controlled by a `chain_protected_timestamp_records` flag on the backup schedule:
```
SHOW SCHEDULES
... {"backup_statement":"BACKUP DATABASE backup_target INTO LATEST IN 'userfile:///backups/backup_target' WITH OPTIONS (detached)","backup_type":1,"chain_protected_timestamp_records":true,"dependent_schedule_id":1117366222981070800,"protected_timestamp_record":"829b152e-8b9d-49c2-8a04-4ac3584451ab"}
```
This is set automatically on new schedules. Any schedule created before this option was added will not have pts enabled.
We should consider backfilling this for pre-existing schedules. We could attach the backfill to full backups. When a full backup completes we have a valid PTS for the schedule and can use it to enable backup chaining.
When PTS chaining is not enabled, backups can fail with the following error:
```
Failed to run backup: running distributed backup to export ranges: exporting /Tenant//Table/: batch timestamp 1750910000.000000000
```
Jira issue: CRDB-55633
Epic CRDB-52076
Contributor guide
Assessment
This issue has not been assessed yet.