tencent cloud

Feedback

Database/Table-Level Rollback to a New Cluster

Last updated: 2024-09-06 11:57:24
    TDSQL-C for MySQL supports restoring data from snapshot backups. Its console provides a convenient operation interface for you to easily achieve fast data restoration. The snapshot backups can be used for database/table-level rollback to the original cluster, database/table-level rollback to a new cluster, and entire cluster rollback to a new cluster. This document introduces how to roll back a database/table from snapshot backups to a new cluster through the console.
    Note:
    During database/table-level rollback to a new cluster from snapshot backups, the selected table will be rolled back to the table state in the corresponding backup file or the corresponding time period, and the unselected table will be synchronized to its latest state through binlog after the rollback to the new cluster.

    Overview

    In case of database misoperation, database testing, or data exceptions caused by failures, the feature of database/table-level rollback to a new cluster allows you to restore the cluster to any time point within the log backup retention period, or restore it to a backup set in a specified backup file, thereby rapidly restoring the database.

    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

    The instance mode of the cluster is provisioned resource.
    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. On the pop-up rollback page, complete the following configuration and click Go to the purchase page to roll back the cluster.
    
    Parameter
    Description
    Select a rollback type
    Select Rollback to New Cluster here.
    Select Restore Scope
    Select Database- or Table-Level Rollback here.
    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 and then select the database/table to be rolled back.
    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. Renaming the selected database is also supported.
    4. After redirecting to the purchase page, complete the following configuration and then click Next.
    Parameter
    Description
    Instance Mode
    Provisioned resource 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.
    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. Renaming the selected database is also supported.
    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.
    5. 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.
    6. 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.
    7. 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.
    8. 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.
    9. 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.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support