MySQL replica SQL thread idles and relay logs grow after short network blips — slave lags and no obvious errors
Environment
Primary and one async replica hosted in same data center (MySQL 8.0.33), replication configured using GTID and a replication user with REPLICATION SLAVE. Replication was healthy for weeks. Intermittent 10–30s packet loss events reported by network monitoring.
Symptoms
Replica shows increasing replication delay (minutes to hours) after several short network interruptions. IO thread reconnects and continues fetching relay logs, but SQL thread remains idle applying no events. SHOW SLAVE STATUS shows Seconds_Behind_Master growing; Last_SQL_Errno is 0, Last_SQL_Error empty.
Observations
Relay-log files accumulate and relay_log_space grows while relay_log_pos advances. SHOW PROCESSLIST on replica shows IO_THREAD active, SQL thread in 'Waiting for master to send event' (or 'Sleep') states intermittently. No corruption logged. Restarting the replica's SQL thread manually with STOP SLAVE; START SLAVE resumes apply. This recurs after next blip. Binlog_checksum and relay_log_info_repository are standard.
Already attempted
Checked disk space and I/O — OK. Verified permissions on relay logs. Increased net_read_timeout and slave_net_timeout temporarily to reduce disconnect churn; problem persists after next network blip. Ran mysqlcheck; no table corruption. Switched to semi-sync off for test — no change. Captured packet traces showing reconnection TCP FIN/ACK sequences during blips.
Question
Why does the replica's SQL thread stop applying after short network blips even though IO thread reconnects and fetches relay logs? How to make replication resilient and avoid manual SQL thread restarts?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags
- Databases25% match
MySQL replica stops with GTID mismatch after skipping a transaction during a network outage
Open0 answers - Databases24% match
MySQL Replica Reports Binlog Checksum Mismatch After Changing Binlog_Format to ROW on Primary
Open0 answers - Virtualization23% match
Docker Swarm overlay network: intermittent inter-node packet loss when two overlay networks share the same subnet/VNI
Open0 answers