Support PITR restore using --start-ts only
kennytm opened this issue · 0 comments
Feature Request
Is your feature request related to a problem? Please describe:
Currently TiDB Operator's PITR required a complete data backup as the starting point, i.e. the Restore
CR required a valid spec.pitrFullBackupStorageProvider
.
---
apiVersion: pingcap.com/v1alpha1
kind: Restore
spec:
restoreMode: pitr
pitrFullBackupStorageProvider: # this item is required
s3:
...
...
This is statically checked in
tidb-operator/cmd/backup-manager/app/restore/restore.go
Lines 96 to 101 in ab875aa
Describe the feature you'd like:
In our scenario, the "starting point" is not a single Full backup, but also followed by a series of Incremental backups. The kernel br
command supports this PITR scenario via the --start-ts
option:
br restore full -s 's3://bucket/full-backup/2024/01'
br restore full -s 's3://bucket/incr-backup/2024/01/01'
br restore full -s 's3://bucket/incr-backup/2024/01/02'
br restore full -s 's3://bucket/incr-backup/2024/01/03'
br restore point -s 's3://bucket/log-backup' --start-ts=446748741183209472 --restored-ts='2024-01-03 13:15:00'
We would like the Restore
CR to expose the --start-ts
option, making the validation required either --start-ts
or --full-backup-storage
(but not both).
---
apiVersion: pingcap.com/v1alpha1
kind: Restore
spec:
restoreMode: pitr
pitrStartTs: '446748741183209472' # <- new option
...
Describe alternatives you've considered:
Rather than exposing --start-ts
, we can make the Restore
CR perform the (Full + Incremental × N) steps like
---
apiVersion: pingcap.com/v1alpha1
kind: Restore
spec:
restoreMode: pitr
pitrFullBackupStorageProvider: ...
pitrIncrementalBackupStorageProviders:
- s3: ...
- s3: ...
But this is considerably more complex and is not suitable for our need (which we have performed the snapshot restore by other means already)
Teachability, Documentation, Adoption, Migration Strategy:
- Update https://docs.pingcap.com/tidb-in-kubernetes/stable/restore-from-aws-s3-using-br#point-in-time-recovery (and the equivalent page for other environments if any) to include the new option.