Note:
When you perform a rollback by using the method in this document, this feature will establish a connection between the original cluster and the new cluster and synchronize databases and tables requiring no rollback through binlogs. This ensures that only the specified databases and tables to be rolled back contain the data at the rollback time and that other databases and tables contain the latest data.
When you perform a rollback by using the method in this document, the VIP switch operation is allowed if the data of the original cluster is fully synchronized with that of the new cluster and if the consistency check passes. Once the VIP is switched, data synchronization will be terminated, and the private VIPs of the original cluster and the new cluster will be exchanged. If VIP switch is canceled, data synchronization will be terminated, and the private VIPs of the original cluster and the new cluster will not be exchanged.
Overview
The cluster rollback optimization scheme applies to the rollback of a single database and table in clusters with a large storage capacity. If the storage usage of the cluster is greater than 1 TB and the databases and tables to be rolled back are large (accounting for more than 70% of the storage usage), this feature can be used to quickly restore data.
Use Limits
The feature of database/table-level rollback to a new cluster is supported only for clusters with binlog enabled.
The feature of database/table-level rollback to a new cluster only supports rollback to local.
During database/table-level rollback to a new cluster, only the provisioned resource instance mode can be selected for the new cluster.
Only the database/table-level rollback to a new cluster supports exchanging VIP addresses with the original cluster, while the entire cluster rollback to a new cluster does not support it.
Cluster VIP Address Switch Capability Description
During database/table-level rollback to a new cluster, the system will create a cluster based on your selection. After the new cluster is verified, you can manually switch the VIP addresses of the read-write instances and read-only instances (if any) between the original cluster and the new cluster within the system-specified time, with no need to switch to the new VIP address in the application. This enables the business to rapidly restore the database access and operations. If the VIP address switch is not performed within the system-specified time, the system considers that you give up switching. After the rollback is completed, you can switch to the new VIP address in the application for connecting to the new cluster, or migrate the data back to the original cluster through DTS and continue using the old cluster. Rollback Modes
Rollback by backup file: Restores a cluster to the dataset state of a snapshot backup file. The selection range of the backup file depends on the data backup retention period you set.
Rollback by time point: Restores a cluster to any time point. The selection range of the time point depends on the log retention period you set.
Note:
During rollback by time point, the system will preferentially use snapshot backups for rollback. If no snapshot backup file is found, logical backups will be used. If you need to perform rollback strictly based on the backup file type (logical backup or snapshot backup), it is recommended to select rollback by backup file.
Prerequisites
Instances in the cluster are of the provisioned resource mode.
A snapshot backup is already available for the original cluster. To generate a snapshot backup, you can refer to the steps for creating a snapshot backup in each document under Performing Backup. The cluster is in the running status.
Directions
1. Log in to the TDSQL-C for MySQL console and click the Cluster ID in the cluster list to enter the cluster management page. 2. On the cluster management page, select the Backup Management tab and click Roll Back.
3. Click Cluster Rollback Optimization Scheme in the upper right corner of the rollback information.
4. On the pop-up rollback page, complete the following configuration and click Go to the purchase page to roll back the cluster.
|
Region | Same as that of the original cluster by default. |
AZ | Same as that of the original cluster by default. |
Rollback Mode | Supports rollback by backup file and by time point. |
Backup File | If the rollback mode is set to rollback by backup file, you need to select an existing snapshot backup file for rollback. |
Rollback Time | If the rollback mode is set to rollback by time point, you need to select a rollback time point. |
Databases/Tables to Roll Back | Select the specific database or table to be rolled back. By default, it will be renamed as the original database/table name after rollback. |
5. After redirecting to the purchase page, complete the following configuration and then click Next.
|
Instance Mode | Select Provisioned resource. |
Rollback Mode | Supports rollback by backup file and by time point. |
Backup File | If the rollback mode is set to rollback by backup file, you need to select an existing snapshot backup file for rollback. |
Rollback Time | If the rollback mode is set to rollback by time point, you need to select a rollback time point. |
Select Restore Scope | Select Database- or Table-Level Rollback here. |
Databases/Tables to Roll Back | Select the specific database or table to be rolled back. By default, it will be renamed as the original database/table name after rollback. |
Region | Same as that of the original cluster by default. Adjustment is not supported. |
Source AZ | Same as that of the original cluster by default. Adjustment is not supported. |
Transfer Linkage | High I/O by default. |
Network | Select VPC. |
Database Version | Same as that of the original cluster by default. |
Instance Type | Supports general and dedicated types. |
Compute Instance (read/write) | Select the compute specifications of the read-write instance. Only 1 read-write instance can be configured. |
Compute Instance (read-only) | If the original cluster has no read-only instances, this setting is unnecessary. If the original cluster has read-only instances, you should select the read-only instances retained. The number and specifications of the read-only instances are the same as those in the original cluster by default. You can delete read-only instances and restore those deleted in this step, but you cannot add read-only instances at this time. To add read-only instances, you can create read-only instances after the rollback is completed. Note: When the number of read-only instances is less than that in the original cluster, the read-only VIP addresses cannot be migrated in full correspondence. |
Compute Billing Mode | Supports monthly subscription and pay-as-you-go. |
Storage Billing Mode | Pay-as-you-go by default. |
6. On the redirect page, configure basic information and advanced settings, including cluster name, default character set, security group, parameter template, and project. After confirming no errors, click Buy Now.
7. Return to the cluster list, find the new cluster created through rollback, and click the Cluster ID to enter the management page for the new cluster.
8. In Cluster Details > Read-Write Instance, click Details of switching behind the read-write address. You should complete the switching within the system-specified time, otherwise, the system considers that you give up switching.
9. Enter the pop-up window for connection address switching, verify the connection address, and perform the following operations as needed.
Confirm the switch: Click Confirm the switch to disconnect from the original cluster. There will be a 1-5 seconds interruption during the process. The original cluster and new cluster will exchange VIP addresses.
Give up switching: Click Give up Switching to disconnect from the original cluster. The original and new clusters will not exchange VIP addresses. After this operation, the VIP address of the current cluster will allow write operations.
Cancel: Click Cancel to close the pop-up window. You can select switching again within the system-specified time.
10. After the above operations are completed, the database/table-level rollback to the new cluster is finished.
Appendix: Real-time Rollback Progress Query
When you have executed a database/table-level rollback to a new cluster, you can query the real-time progress of the tasks (Database/Table Rollback to New Cluster, and Create New Cluster for Database/Table Rollback) through the task list.
2. Click Task List in the left sidebar to enter the task list page.
3. Select the corresponding region at the top.
4. Find the task item for which you need to query the task details (Database/Table Rollback to New Cluster, and Create New Cluster for Database/Table Rollback), and click Task Details in the Operation column to check the progress.