Failover and Reprotect Databases

Databases in a recovery group are replicated from one cluster to another, typically in a different region of the cloud service provider.

The Failover action promotes the replicated databases in the secondary region to be the new primary copy, ensuring ongoing availability during a regional outage.

When the regional outage is resolved, the ability to reverse the replication from the recovery region back to the original region is done using the Reprotect action. This ensures that the databases are protected against future disasters impacting their new region, and prepares them for migration back to the original region if desired.

Prerequisites

Before performing a failover, a recovery group should have been created and be successfully replicating to the secondary cluster. For more information, see Get Started with Recovery Groups.

Protected Recovery Group

Failover databases using a recovery group

In the event of a disaster, you can use the recovery group to failover databases to the secondary cluster.

  1. In the TiDB Cloud console, click in the lower-left corner, switch to the target project if you have multiple projects, and then click Project Settings.

  2. In the Project Settings navigation pane, click Recovery Group.

  3. On the Recovery Group page, locate the name of the recovery group that you wish to failover.

  4. Click the Action menu for the recovery group, and then click Failover. The failover dialog is displayed.

  5. Select the secondary TiDB Cloud cluster to be promoted to the primary copy. Ensure that the selected cluster is in a healthy state.

  6. Confirm that you understand the potentially disruptive nature of a failover by typing Failover into the confirmation entry and clicking I understand, failover group to begin the failover.

    Fail Over Recovery Group

Reprotect databases using a recovery group

After a failover completes, the replica databases on the secondary cluster are now the primary copy. However, these databases are unprotected against future disasters as the replication relationship is stopped by the failover process.

If the original primary cluster that was affected by the disaster can be brought online again, you can re-establish replication from the recovery region back to the original region using the Reprotect action.

Unprotected Recovery Group

  1. In the TiDB Cloud console, click in the lower-left corner, switch to the target project if you have multiple projects, and then click Project Settings.

  2. In the Project Settings navigation pane, click Recovery Group.

  3. On the Recovery Group page, locate the name of the recovery group that you wish to reprotect.

  4. Click the Action menu for the recovery group, and then click Reprotect. The reprotect dialog is displayed.

  5. Confirm the reprotect operation by clicking Reprotect to begin the reprotect operation.

    Reprotect Recovery Group

Was this page helpful?