Bug #34436 Binlog corruption on inserts with utf8
Submitted: 8 Feb 2008 23:31 Modified: 16 Mar 2008 6:12
Reporter: Patrick Galbraith Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:5.0.45 OS:Linux (Ubuntu Edgy)
Assigned to: CPU Architecture:Any
Tags: 5.0.45-log

[8 Feb 2008 23:31] Patrick Galbraith
Description:
I have replication handling a site that replicates feeds being inserted into a database, stored into mediumtext columns. Many of these feeds have utf8 characters in them, so I suspect this is the problem. It completely breaks replication:

80208 15:19:14 [ERROR] Got fatal error 1236: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master' from master when reading data from binary log
080208 15:19:14 [Note] Slave I/O thread exiting, read up to log 'bin.000564', position 321442336

so, I increased max_allowed_packet to 1000M (yes, crazy). Didn't fix it upon restarting the slave.

So, I skipped to the next log. Then upon further inspection:

oot@db1:/data/mysql_datadir# mysqlbinlog -f -H --start-position=321442336 bin.000564> foo.sql
ERROR: Error in Log_event::read_log_event(): 'Event too big', data_len: 1835627621, event_type: 97
Could not read entry at offset 321442336:Error in log format or read error

So, it seems there's corruption. Could the UTF8 cause the slave thread to not be able to read events properly from the binary log?

I can provide this binary log if need be. 

I don't know what query caused this since I can't read the binlog in the first place and therefore can't reproduce it easily.

How to repeat:
Not sure what insert statement amongst thousands caused this.

I can provide the binlog.
[10 Feb 2008 18:25] Valeriy Kravchuk
Thank you for a problem report. Please, upload compressed binary log to our FTP site and inform about file name and size/MD5 checksum. 

Try to repeat with a newer version, 5.0.51a, also.
[11 Feb 2008 13:51] Patrick Galbraith
Valeriy,

Thank you very much for the response. I have uploaded bin.000564.save and bin.000564.save.md5 (d01d6abf7faacb2e6117e37a3e9ea53d) to ftp.mysql.com/pub/mysql/upload . I'd be very interested to know what might have caused this error.

I am upgrading mysql to 5.0.51 and will run the same type of test that exposed this issue and will let you know if I encounter it again.
[16 Feb 2008 6:12] Sveta Smirnova
Thank you for the report.

Did you increase max_allowed_packet on slave? If yes and you still get errors please provide output of SHOW SLAVE STATUS \G
[17 Mar 2008 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".