tencent cloud

TencentDB for MySQL

Release Notes and Announcements
Release Notes
Product Announcements
User Tutorial
Product Introduction
Overview
Strengths
Use Cases
Database Architecture
Resource Isolation Policy
Economical Instance
Feature List
Database Instance
High Availability (Multi-AZ)
Regions and AZs
Service Regions and Service Providers
Kernel Features
Overview
Kernel Version Release Notes
Functionality Features
Performance Features
Security Features
Stability Features
TXRocks Engine
LibraDB Engine
Checking and Fixing Kernel Issues
Purchase Guide
Billing Overview
Selection Guide
Purchase Methods
Renewal
Payment Overdue
Refund
Pay-as-You-Go to Monthly Subscription
Instance Adjustment Fee
Backup Space Billing
Database Audit Billing Overview
Commercial Billing and Activity Description for Database Proxy
Description of the Database Proxy Billing Cycle
Viewing Bills
Getting Started
Overview
Creating MySQL Instance
Connecting to MySQL Instance
SQL Insight (Database Audit)
Overview
Viewing Audit Instance List
Enabling Audit Service
Viewing Audit Log
Log Shipping
Configuring Post-Event Alarms
Modifying Audit Rule
Modifying Audit Services
Disabling Audit Service
Audit Rule Template
SQL Audit Rule (Legacy)
Viewing Audit Task
Authorizing Sub-User to Use Database Audit
MySQL Cluster Edition
Introduction to TencentDB for MySQL Cluster Edition
Creating TencentDB for MySQL Cluster Edition Instance
Maintenance Management Instance
Viewing Instance Monitoring
Adjusting Instance Configuration
Operations for Other Features
Migrate or upgrade to TencentDB for MySQL Cluster Edition
Operation Guide
Use Limits
Operation Overview
Instance Management and Maintenance
Instance Upgrade
CPU Elastic Expansion
Read-Only/Disaster Recovery Instances
Database Proxy
Database Management Center (DMC)
Account Management
Parameter Configuration
Backup and Rollback
Data Migration
Network and Security
Monitoring and Alarms
Log Center
Read-Only Analysis Engine
Tag
Practical Tutorial
Using TencentDB for MySQL to Upgrade MySQL 5.7 to MySQL 8.0
Methods and Instructions for Upgrading from MySQL 5.6 to MySQL 5.7
Cybersecurity Classified Protection Practice for Database Audit of TencentDB for MySQL
Building All-Scenario High-Availability Architecture
Usage Specifications of TencentDB for MySQL
Configuring Automatic Application Reconnection
Impact of Modifying MySQL Source Instance Parameters
Limits on Automatic Conversion from MyISAM to InnoDB
Creating VPCs for TencentDB for MySQL
Enhancing Business Load Capacity with TencentDB for MySQL
Setting up 2-Region-3-DC Disaster Recovery Architecture
Improving TencentDB for MySQL Performance with Read/Write Separation
Migrating Data from InnoDB to RocksDB with DTS
Building LAMP Stack for Web Application
Building Drupal Website
Calling MySQL APIs in Python
The primary and secondary instances have inconsistent query data
White Paper
Performance White Paper
Security White Paper
Troubleshooting
Connections
Performance
Instance Data Sync Delay
Failure to Enable Case Insensitivity
Failure to Obtain slow_query_log_file via a Command
API Documentation
History
Introduction
API Category
Instance APIs
Making API Requests
Data Import APIs
Database Proxy APIs
Database Audit APIs
Security APIs
Task APIs
Backup APIs
Account APIs
Rollback APIs
Parameter APIs
Database APIs
Monitoring APIs
Log-related API
Data Types
Error Codes
FAQs
Related to Selection
Billing
Backup
Rollback
Connection and Login
Parameter Modifications
Instance Upgrade
Account Permissions
Performance and Memory
Ops
Data Migration
Features
Console Operations
Logs
Event
Database audit
Instance Switch Impact
API 2.0 to 3.0 Switch Guide
Service Agreement
Service Level Agreement
Terms of Service
Reference
Standards and Certifications
Contact Us
Glossary

Managing Delayed Replication of Read-Only Instance

PDF
Focus Mode
Font Size
Last updated: 2026-01-06 12:11:47
This document describes how to set delayed replication for read-only instances and enable/disable replication in the TencentDB for MySQL console. You can set delayed replication (i.e., delay between a read-only instance and its source instance) and select to replay by flashbacked position or global transaction identifier (GTID) during the delay to efficiently roll back data and fix failures.
Delayed Replication: you can enable and configure the replication delay between a read-only instance and its source instance on its RO group configuration page or management page.
Enabling/Disabling Replication: you can manually enable or disable data sync between a read-only instance and its source instance.

Delayed Replication Description

After delayed replication is enabled for a read-only instance, it will be removed from the RO group with its weight set to 0, and a removal alarm will be triggered. At this point, the traffic will not be forwarded to the removed instance if the RO VIP is used to access the RO group. What's more, the removed instance can only be accessed via the instance's VIP.
After the delayed replication is disabled for a read-only instance ( the corresponding RO group has enabled delayed-replication-read-only-instance removal), the weight of this read-only instance in the RO group will be recovered only if the delay time of this instance is less than the delay threshold of the RO group. And a restoration alarm will be triggered at the same time.
During replay by flashbacked position, you cannot restart the instance, adjust its configuration, upgrade its version, or upgrade its kernel minor version.

Enabling Delayed Replication

Note:
Delayed Replication is disabled for a read-only instance by default. If it is enabled, the delayed replication time will be displayed.

Enabling on the read-only instance's RO group configuration page

1. Log in to the TencentDB for MySQL console. In the instance list, click a source instance ID to enter the instance management page.
2. On the instance management page, select the Read-Only Instance tab, locate the desired RO group, and click Configuration to enter the RO group configuration page.

3. On the RO group configuration page, enable Delayed Replication, set the Replication Delay, and click OK. You can set delayed replication and select to replay by flashbacked position or global transaction identifier (GTID) during the delay to efficiently roll back data and fix failures.
Replication Delay: You can configure the time of delayed replication between a read-only instance and its source instance. The value range is 1–259200 seconds.
Remove Delayed RO Instances: This option indicates whether to enable the removal policy. If a read-only instance is removed when its delay exceeds the threshold, its weight will be set to 0 automatically, and alarms will be sent (for more information on how to configure the read-only instance removal alarm and recipients, see Alarm Policies (TCOP)).
Delay Threshold: This sets a delay threshold for the read-only instance. When the threshold is exceeded, the instance will be removed from the read-only group.
Least RO Instances: This is the minimum number of instances that should be retained in the RO group. When there are fewer instances in the RO group, even if an instance exceeds the delay threshold, it will not be removed.
Assign Read Weight: The RO group supports two weight assignment methods: automatic assignment by the system and custom assignment. The weight value must be an integer between 0 and 100.
Load Rebalancing:
Modifying weight will only affect new loads if rebalancing is disabled. The operation has no impact on read-only instances accessed by existing persistent connections and does not cause momentary database disconnection.
If rebalancing is enabled, all connections to the database will be temporarily disconnected, and the loads of newly added connections will be balanced according to the set weights.


Enabling on the read-only instance management page

1. Log in to the TencentDB for MySQL console. In the instance list, click a read-only instance ID or Manage in the Operation column to access the read-only instance details page.
2. On the read-only instance details page, click Enable in Instance Info > Delayed Replication.

3. In the pop-up window, set the delay and click OK.
Note:
The delay ranges from 1 to 259,200 seconds. Read-Only instances in the same RO group share the same replication delay. If one instance is modified, the rest will be modified automatically at the same time.


Modifying Delayed Replication

Modifying on the read-only instance's RO group configuration page

1. Log in to the TencentDB for MySQL console. In the instance list, click a source instance ID to enter the instance management page.
2. On the instance management page, select the Read-Only Instance tab, locate the desired RO group, and click Configuration to enter the RO group configuration page.
3. On the RO group configuration page, modify Replication Delay and click OK.

Modifying on the read-only instance management page

1. Log in to the TencentDB for MySQL console and click a read-only instance ID in the instance list to enter the read-only instance details page.
2. On the read-only instance details page, choose Instance Info > Delayed Replication, and click the edit icon.

3. In the pop-up window, set the delay and click OK.

Disabling Delayed Replication

Disabling on the read-only instance's RO group configuration page

1. Log in to the TencentDB for MySQL console. In the instance list, click a source instance ID to enter the instance management page.
2. On the instance management page, select the Read-Only Instance tab, locate the desired RO group, and click Configuration to enter the RO group configuration page.
3. On the RO group configuration page, click Disable after Delayed Replication, and then click OK.

Disabling on the read-only instance management page

1. Log in to the TencentDB for MySQL console and click a read-only instance ID in the instance list to enter the read-only instance details page.
2. On the read-only instance details page, click Disable in Instance Info > Delayed Replication.
3. In the pop-up dialog box, confirm that everything is correct and click OK.
Note:
If delayed replication is disabled, the delayed replication time will be 0 seconds, that is, real-time data sync is resumed between the read-only instance and its source instance. >

Enabling Data Replication

Note:
The Replication Status of a read-only instance is Normal by default. If you set delayed replication and delete data accidentally during the delayed replication time period, you can restore the read-only instance to the specified position or GTID of the binlog file to implement quick data restoration.
1. Log in to the TencentDB for MySQL console and click a read-only instance ID in the instance list to enter the read-only instance details page.
2. On the read-only instance details page, click Enable in Instance Info > Replication Status.
3. In the pop-up window, click OK.
Note:
Once the replication is enabled, the data sync between the read-only instance and the source instance will resume.
4. You can also go to Instance Info > Replication Operation and select Replay by Flashbacked Position. You can specify the start time to a specific point and the corresponding GTID. After the read-only instance is restored to a specific time point or the corresponding GTID, it will stop replication until it is switched to the normal startup mode, at which point replication will resume.
Time: You can select a time point between the replication end time and the current time of the source instance.
GTID: You can select all logs after the binlog not applied. If GTID is selected, data will be replicated until the specified GTID is reached. The length of instance server_uuid is fixed at 36 bits, and the GTID must be in server_uuid:transaction_id format.
Note:
If the entered binlog position has already been applied on the read-only instance or is after the source instance position, replication will fail to be enabled.
When you enable replication, if there is any breakpoint in the binlog, replication will fail to be enabled.
To avoid overusing the disk space of a delayed read-only instance when replication is disabled for it, the I/O thread of the read-only instance will be paused when its available disk space drops below 5 GB.

5. During the process of replay by flashbacked position, you can click Replaying after Replication Status to query and refresh the task details.
6. After the replication is completed, click Enable after Replication Status, and the read-only instance can continue to replicate.

Disabling Data Replication

Note:
Only after delayed replication is enabled can it be disabled; otherwise, the Disable button is grayed out.
Once replication is disabled, I/O and SQL threads will also be ended.
1. Log in to the TencentDB for MySQL console and click a read-only instance ID in the instance list to enter the read-only instance details page.
2. On the read-only instance details page, click Disable in Instance Info > Replication Status.

3. In the pop-up dialog box, confirm that everything is correct and click OK.

FAQs

How do I get the GTID?

We recommend you run the flush log command to get the binlog file to locate the position and GTID of the maloperation.

How do I view the delay?

You can view the latency between the read-only instance and the primary instance in the Instance Architecture Diagram section on the Console > Instance Details page.


How do I view the task information of replay by flashbacked position?

You can view the task progress and details on the task list page in the console.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback