MySQL replication: How to recover from “Event too small corruption” or “Slave SQL: Relay log read failure”

The basic principle is, just restart where the slave left off. The problem arises if a binary log, on the slave side, remains corrupt. The recovery is relatively simple, just follow the recipe:

  1. STOP SLAVE
  2. SHOW SLAVE STATUS
  3. Note down ‘Relay_Master_Log_File’ and ‘Exec_Master_Log_Pos’ entries.
  4. RESET SLAVE
  5. CHANGE MASTER TO ….. (use MASTER_LOG_FILE=relay_master_log_file and MASTER_LOG_POS=exec_master_log_pos from Step 3)
  6. START SLAVE

This basically deletes all current relay logs from the slave and restarts replicating from exactly where it stopped by requesting a fresh binlog from the master.


Posted

in

,

by

Tags:

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from try {} except

Subscribe now to keep reading and get access to the full archive.

Continue reading