Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports FLASHBACK TO TIMESTAMP in TiDB #37197

Closed
15 of 20 tasks
Defined2014 opened this issue Aug 18, 2022 · 1 comment
Closed
15 of 20 tasks

Supports FLASHBACK TO TIMESTAMP in TiDB #37197

Defined2014 opened this issue Aug 18, 2022 · 1 comment

Comments

@Defined2014
Copy link
Contributor

Defined2014 commented Aug 18, 2022

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

  • 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
  • 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 and tso 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)
@bb7133 bb7133 changed the title Supports flash back cluster in TiDB Supports FLASHBACK CLUSTER in TiDB Aug 18, 2022
@Defined2014 Defined2014 changed the title Supports FLASHBACK CLUSTER in TiDB Supports FLASHBACK TO TIMESTAMP in TiDB Oct 19, 2022
@Defined2014
Copy link
Contributor Author

No further plan right now, close it firstly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant