Databases 13 min read

MySQL Replication Failure Analysis: Error 1594 and Relay Log Corruption

This article analyzes a MySQL master‑slave replication failure where the SQL thread stopped with error 1594, detailing log inspection, CRC checks, relay‑log corruption, root‑cause identification, and step‑by‑step remediation procedures for restoring replication.

Aikesheng Open Source Community
Aikesheng Open Source Community
Aikesheng Open Source Community
MySQL Replication Failure Analysis: Error 1594 and Relay Log Corruption

The client reported a MySQL master‑slave replication failure: the SQL thread stopped with error code 1594 while the I/O thread continued fetching logs. Initial investigation showed the relay log could not be parsed, indicating a possible corruption.

Running SHOW SLAVE STATUS\G on the replica revealed Slave_SQL_Running: No and Last_Errno: 1594 with a detailed error message about relay log read failure and possible reasons such as binary log corruption, relay log corruption, network issues, or bugs.

Examining the error logs confirmed CRC check failures (e.g., "Event crc check failed! Most likely there is event corruption.") and indicated that the last transaction was not fully written, suggesting relay‑log damage possibly caused by disk faults, abrupt shutdowns, or oversized transactions exceeding max_allowed_packet .

Further checks ruled out system‑level issues (no OOM, sufficient disk space, normal network status) and identified a large transaction (≈20 MB) that likely triggered the problem. The relay log at the failure point was examined with mysqlbinlog --verify-binlog-checksum mysql-relay.000007 , which reported CRC errors and incomplete row events.

To reproduce the issue, a local environment was set up with the same MySQL version (5.7.26, GTID enabled). The replica status matched the client’s, showing Slave_SQL_Running: No . The SQL thread was stopped with STOP SLAVE SQL_THREAD; , the status re‑checked, and then the thread was restarted after editing the relay log using hexedit to simulate corruption.

After confirming the relay‑log corruption as the root cause, the article provides a checklist for future troubleshooting: preserve logs, verify CRC, check disk health, ensure sufficient space, monitor transaction sizes, and use mysqlbinlog for verification.

In summary, the 1594 error is typically caused by relay‑log corruption due to incomplete transaction writes, disk failures, or misconfiguration, and can be resolved by repairing or rebuilding the relay log and restarting the replication threads.

MySQLReplicationtroubleshootingRelay LogCRCError 1594
Aikesheng Open Source Community
Written by

Aikesheng Open Source Community

The Aikesheng Open Source Community provides stable, enterprise‑grade MySQL open‑source tools and services, releases a premium open‑source component each year (1024), and continuously operates and maintains them.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.