MySQL Forums
Forum List  »  Replication

Re: Replication crashes when max_bin_log_size is reached
Posted by: Guilhem Bichot
Date: May 23, 2005 03:30AM

now the crash is in memcpy() when trying to write to Coming back to the beginning:
050219 7:21:03 Could not use ensim-relay-bin for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
050219 7:21:03 next log error: -1 offset: 22 log: ./ensim-relay-bin.004
050219 7:21:03 Error reading relay log event: Error purging processed log
050219 7:21:03 Slave: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave. Error_code: 0
050219 7:21:03 Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'freebsds-bin.002' position 624574097
mysqld got signal 11;

The crash is expected (that is, you would not expect it and I don't consider it as normal, but looking at the code I understand why it crashes) as soon as there is this error "could not use ensim-relay-bin for logging". Relay log rotation is: it closes the current relay log and creates a new one. The creation of the new one fails (I don't know how and why, maybe it succeeds on disk but fails inside MySQL). So this error is printed and the relay log is marked as "closed" by the thread doing the rotation. Just after that the slave SQL thread comes and wants to write to the relay log, and (bug) it's not prepared to it being closed: it just expects it to always be open. So it tries to write to freed memory which is not nice of course... and segmentation fault.
We'll fix this segfault bug, but we have the more important one: why does it say it "could not use ensim-relay-bin for logging (error 13)"?? From the "error -1 offset 22" it could have to do with the relay log index file. I see two way to troubleshoot this:
1) install our debug binary on the slave and let it run with the --debug=d:t:i:O,/tmp/mysqld.trace option. It will run slower (sometimes) much slower than the normal binary. Let the slave run and crash and I'll tell you were to send us a copy of /tmp/mysqld.log (we won't need this entire file, probably only the end of it). and for old versions
2) let the slave run again and:
- before it rotates the relay log, save a copy of "ls *relay*" and a copy of the ensim-relay-bin.index file
- after it rotates and crashes (*before* you restart mysqld after the crash), save the same things again
and post them all here.
Good luck. By the way, it may be time to look into upgrading your slave to 4.1; 4.0 is starting to be old, I'd like to exclude the possibility of an already fixed bug.

Options: ReplyQuote

Written By
Re: Replication crashes when max_bin_log_size is reached
May 23, 2005 03:30AM

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.