The combination of max_allowed_packet variable and replication in MySQL is a common source of headaches. In a nutshell, max_allowed_packet is the maximum size of a MySQL network protocol packet that the server can create or read. It has a default value of 1MB (<= 5.6.5) or 4MB (>= 5.6.6) and a maximum size of 1GB. This adds some constraints in our replication environment:
- The master server shouldn’t write events to the binary log larger than max_allowed_packet
- All the slaves in the replication chain should have the same max_allowed_packet as the master server
Sometimes, even following those two basic rules we can have problems.
For example, there are situations (also called bugs) where the master writes more data than the max_allowed_packet …[Read more]