Skip to content

Supports FLASHBACK TO TIMESTAMP in TiDB #37197

Closed
@Defined2014

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

  • 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)

Activity

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions