Updated on 2025-10-28 GMT+08:00

Primary/Standby Replication Delay Increases Sharply and Then Decreases

Scenario

The metric Real-Time Replication Delay of a read replica increased sharply and then fell back on the Cloud Eye console.

Possible Causes

  • This problem is related to the method of calculating the value of Seconds_Behind_Master. For details about how to calculate this field, see How Primary/Standby Replication Works.
  • The replication delay peak occurred because the I/O thread of the read replica received a new binlog file, but the SQL thread did not start to replay the new binlog file. As a result, the value of last_master_timestamp for calculating Seconds_Behind_Master is the time when the previous binlog transaction was executed on the primary node, which is different from the system time (time (0)) of the read replica. When the SQL thread started to parse the new binlog file, the replication delay immediately decreased.
  • This problem occurs occasionally and does not affect your workloads.

The following symptom was found in the binlog files generated during the period when the replication delay increased sharply and then fell back:

The difference between the start time of the first transaction in the new binlog file and the end time of the last transaction in the previous binlog file was the same as the difference between the sudden increase and fallback times.

Solution

No action is required. This scenario is normal and occasionally occurs.