# 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`
- **Domain:** database
- **Category:** data_error
- **Error Code:** `1594`
- **Verification:** ai_generated
- **Fix Rate:** 75%

## Root Cause

MySQL relay log is corrupted or truncated, often due to disk I/O errors or abrupt server shutdown during replication.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| MySQL 5.7 | active | — | — |
| MySQL 8.0 | active | — | — |
| MySQL 8.4 | active | — | — |

## Workarounds

1. **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)** (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)
   ```
2. **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)** (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)
   ```

## Dead Ends

- **Restart the MySQL replica service without fixing the relay log** — The corrupted relay log persists and will be re-read, causing the same error immediately. (95% fail)
- **Manually delete relay log files and restart replication without resetting** — MySQL still expects the relay log index to reference the deleted files, leading to further errors. (80% fail)
