1

Our Slave Server disk drive got full, replication stopped, so we cleared space off, and started replication again. Well, all was good until we ran into a corrupt relay bin file on the slave (used mysqllogbin to insure).

What do we do? Can we remove the corrupt bin file, and restart, hoping it will rebuild that file?

Little lost on what to do, any help would be great.

We are running 5.1, have a master, and a slave.

I may be missing info, or not being clear enough, if so, let me know and I can fill you in.

0

2 Answers 2

3
SHOW SLAVE STATUS\G

Record the values shown for Relay_Master_Log_File and Exec_Master_Log_Pos, which show the last position from the master's binary logs that executed successfully.

Use CHANGE MASTER to cause the slave to copy the binary log from that point on again, replacing the relay logs with fresh ones:

STOP SLAVE;
CHANGE MASTER TO 
  master_log_file='<Relay_Master_Log_File>', 
  master_log_pos=<Exec_Master_Log_Pos>;
  -- replace those two tags with the values you recorded earlier
START SLAVE;
1

You can try and skip 1 record if that is corrupted. You can do this by doing:

set global sql_slave_skip_counter=1; start slave;

then do

show slave status\G

and see if its ok.

You can repeat this a few times until it starts replicating properly.

If on the other hand, you feel you lost too much data and the slaves are out of sync, then you can do a new mysqldump of the master to resync them.

Lastly, maatkit has a syncing tool that will do a checksum on both tables and will try to sync them for you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .