1594
database
data_error
ai_generated
true
ERROR: Relay log read failure: could not parse relay log event. The slave is stopped. Last_IO_Error: error reading relay log event: relay log read failure
ID: database/mysql-slow-replica-lag-bytes-behind
75%Fix Rate
85%Confidence
1Evidence
2024-03-15First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| MySQL 5.7 | active | — | — | — |
| MySQL 8.0 | active | — | — | — |
| MySQL 8.4 | active | — | — | — |
Root Cause
MySQL relay log is corrupted or truncated, often due to disk I/O errors or abrupt server shutdown during replication.
generic中文
MySQL 中继日志损坏或被截断,通常是由于磁盘 I/O 错误或复制过程中服务器意外关闭。
Official Documentation
https://dev.mysql.com/doc/refman/8.0/en/replication-options-replica.htmlWorkarounds
-
85% success STOP SLAVE; RESET SLAVE; CHANGE MASTER TO ...; START SLAVE; (reinitialize replication from scratch using SHOW SLAVE STATUS to get the correct master log file and position, or use GTID if enabled)
STOP SLAVE; RESET SLAVE; CHANGE MASTER TO ...; START SLAVE; (reinitialize replication from scratch using SHOW SLAVE STATUS to get the correct master log file and position, or use GTID if enabled)
-
70% success STOP SLAVE; SET GLOBAL relay_log_purge=0; START SLAVE; (if the error is transient, this may skip the bad event but risks data inconsistency)
STOP SLAVE; SET GLOBAL relay_log_purge=0; START SLAVE; (if the error is transient, this may skip the bad event but risks data inconsistency)
中文步骤
STOP SLAVE; RESET SLAVE; CHANGE MASTER TO ...; START SLAVE; (reinitialize replication from scratch using SHOW SLAVE STATUS to get the correct master log file and position, or use GTID if enabled)
STOP SLAVE; SET GLOBAL relay_log_purge=0; START SLAVE; (if the error is transient, this may skip the bad event but risks data inconsistency)
Dead Ends
Common approaches that don't work:
-
Restart the MySQL replica service without fixing the relay log
95% fail
The corrupted relay log persists and will be re-read, causing the same error immediately.
-
Manually delete relay log files and restart replication without resetting
80% fail
MySQL still expects the relay log index to reference the deleted files, leading to further errors.