Closed
Description
Background
Some users want to flash back the whole cluster to a determined timestamp when there is a problem with the database like delete some important values etc. In TiDB we use MVCC to store the key values in TiKV which means we could easy to flash back it before gc complete. This issue is the tracking issue for flashback cluster
feature.
Task
Docs
TiDB
- Parser supports
flash back cluster as of timestamp 'expression'
#37229 - support
flashback cluster
pre-check #37262
- privilege check, a user with
SUPER
permission can run this stmts - check TS
- check ddl history, can't have ddl jobs during
flashback
- check tiflash node, can't do it with tiflash
- forbid & restart processing new ddl job in queue
- close & recover pd scheduling
- close & recover gc
- Execution
- Support flashback table/databases
- Others
- show/get
flashback cluster
progress state from TiKV - Refetch statistics from TiKV
- forbiden cancel flashback job in some states.
- Reset Auto ID (optional)
- Add
flashback
to telemetry #38896
- add gc_savepoint (optional)
- add a system table
gc_savepoint
- support auto set savepoint by TiDB itself
- add a map according to natural physical time (Unix timestamp) -> TSO to avoid TSO drifts
Client-go
- TiDB provide
key range
andtso
to client-go, then client-go sending requests to all Region leaders in the key range (Could reuse some mechanism in client-go now, like backoff/coprocessor etc.) - Forbid read/write request to specified region during
flashback cluster
- Need an interface to get progress of
flashback cluster
TiKV
PD
- Add an interface to add/delete gc_savepoint (optional)
Activity