MySQL Forums
Forum List  »  Replication

Repairing broken replication
Posted by: Christian Lathion
Date: November 01, 2007 04:19PM

Hi all,

I have a problem that I already saw on this forum, but without clear answer.
I hope someone can help.

Here is the situation:

Both our master and slave server crashed (due to a power outage).
After reboot, everything went fine on the master side.
But the replication didn't start on the slave, because it searches for an invalid position in the bin log file:

071101 5:43:10 Slave I/O thread: connected to master 'repl@master-server:3306', replication started in log 'Master-bin.11042' at position 109669854
071101 5:43:10 Error reading packet from server: Client requested master to start replication from impossible position (server_errno=1236)
071101 5:43:10 Got fatal error 1236: 'Client requested master to start replication from impossible position' from master when reading data from binary log
071101 5:43:10 Slave I/O thread exiting, read up to log 'Master-bin.11042', position 109669854

Indeed, this position doesn't exist (bin log file is too small).
Mysqlbinlog confirms there is a problem at the end of the log:

Master# mysqlbinlog Master-bin.11042 | tail

ERROR: Error in Log_event::read_log_event(): 'Event too small', data_len: 0, event_type: 0
Could not read entry at offset 109658149:Error in log format or read error

#071031 15:46:26 server id 1 log_pos 109657708 Query thread_id=8 exec_time=0 error_code=0
SET TIMESTAMP=1193874386;
...
# at 109657832
#071031 15:46:26 server id 1 log_pos 109657832 Query thread_id=120811 exec_time=0 error_code=0
...

I guess the binlog was correctly sent to the slave, but not synced to the master's hard disk due to the power outage.
Seems confirmed by reading this:
http://bugs.mysql.com/bug.php?id=9726

My idea is to change the slave binlog position to the beginning of the next master binlog (Master-bin.11043, position 0)
In the mentioned thread, the person suggests that sending a "log_rotation event" to the slave should fix the issue, but I don't know how to do this.
I suppose it is the same as changing the position in slave binlog by hand.

Can you confirm that doing so is safe?
It seems to be an obvious solution, but I didn't find it proposed anywhere.


Thank you for support.

Options: ReplyQuote


Subject
Views
Written By
Posted
Repairing broken replication
7055
November 01, 2007 04:19PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.