Bug #50581 max_allowed_packet is exceeded on slave with same settings than master
Submitted: 25 Jan 2010 9:10 Modified: 12 Sep 2010 6:29
Reporter: Oli Sennhauser Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:5.0.84 OS:Any
Assigned to: Andrei Elkin CPU Architecture:Any

[25 Jan 2010 9:10] Oli Sennhauser
Description:
Customer experiences:

Replication stopped working in production - looks like it choked on a giant query. The error log on the replication server reads:

# cat error.log
100120 7:00:34 [ERROR] Error reading packet from server: Got packet bigger than 'max_allowed_packet' bytes
( server_errno=2020)
100120 7:00:34 [ERROR] Log entry on master is longer than max_allowed_packet (1049241) on slave. If the entry is
correct, restart the server with a higher value of max_allowed_packet
100120 7:00:34 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.021480', position 3188268

He states that the m_a_p settings are the same on master and on slave.

How to repeat:
mysql> drop schema candystand_v2;
mysql> create schema candystand_v2;
shell> mysql -u root candystand_v2 < full_structure_dump.sql
shell> mysql -u root candystand_v2 < mysql-bin.021480
ERROR 1153 (08S01) at line 1: Got a packet bigger than 'max_allowed_packet' bytes                                              

When I set the max_allowed_package to 10m (size is bigger than the binary log in total).

I get this:
mysql -u root --max_allowed_packet=10m candystand_v2 < mysql-bin.021480
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '�binX�VK

mysqlbinlog converts this binary log to human readable form without any problem.

Either bug or binlog corruption is detected...

Suggested fix:
Fix bug or make something which states, that the binary log is corrupt.
[25 Jan 2010 9:10] Oli Sennhauser
Looks similar to bug

  http://bugs.mysql.com/bug.php?id=19402
[25 Jan 2010 9:11] Oli Sennhauser
Customer stated that the problem went away when he set m_a_p to a higher value. So it might NOT be a corruption?
[25 Jan 2010 11:31] Oli Sennhauser
Applying the binary log to a 5.1.42 causes the same symptoms as with 5.0.x.
[12 Sep 2010 6:22] MySQL Verification Team
oli, do you realize you are trying to import a binlog file without first running mysqlbinlog ?