# FLASHBACK CLUSTER
+ Recover a cluster to a specific point in time

```
FLASHBACK CLUSTER TO TIMESTAMP '2024-05-20 18:00:00';
FLASHBACK CLUSTER TO TSO 625494839813079041;
```
-----------------------------------------------------------------

In TiDB v6.4.0, user can use `FLASHBACK CLUSTER TO TIMESTAMP` and `FLASHBACK CLUSTER TO TSO`(from v6.5.6) to recover a cluster to a specific point in time.

The time specified in the `FLASHBACK` statement must be within the `Garbage Collection (GC) lifetime`. The system variable `tidb_gc_life_time` (default: 10m0s) defines the retention time of earlier versions of rows. The current safePoint of where garbage collection has been performed up to can be obtained with the following query:
```
SELECT * FROM mysql.tidb WHERE variable_name = 'tikv_gc_safe_point';
```

Only a user with the `SUPER` privilege can execute the `FLASHBACK CLUSTER` SQL statement.

`FLASHBACK CLUSTER` does not support rolling back DDL statements that modify PD-related information, such as `ALTER TABLE ATTRIBUTE`, `ALTER TABLE REPLICA`, and `CREATE PLACEMENT POLICY`.

At the time specified in the FLASHBACK statement, there cannot be a DDL statement that is not completely executed. If such a DDL exists, TiDB will reject it.

Before executing `FLASHBACK` CLUSTER, TiDB disconnects all related connections and prohibits read and write operations on these tables until the `FLASHBACK CLUSTER` statement is completed.

The `FLASHBACK CLUSTER` statement cannot be canceled after being executed. TiDB will keep retrying until it succeeds.

During the execution of `FLASHBACK CLUSTER`, if you need to back up data, you can only use Backup & Restore and specify a `BackupTS` that is earlier than the start time of `FLASHBACK CLUSTER`. In addition, during the execution of `FLASHBACK CLUSTER`, enabling log backup will fail. Therefore, try to enable log backup after `FLASHBACK CLUSTER` is completed.

The working principle of `FLASHBACK CLUSTER TO [TIMESTAMP|TSO]` is to write the old data of a specific point in time with the latest timestamp, and will not delete the current data. So before using this feature, you need to ensure that there is enough storage space for the old data and the current data.