mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
BUG#12400221 - 60926: BINARY LOG EVENTS LARGER THAN MAX_ALLOWED_PACKET
Problem ======== Replication breaks in the cases if the event length exceeds the size of master Dump thread's max_allowed_packet. The reason why this failure is occuring is because the event length is more than the total size of the max_allowed_packet, on addition of the max_event_header length exceeds the max_allowed_packet of the DUMP thread. This causes the Dump thread to break replication and throw an error. That can happen e.g with row-based replication in Update_rows event. Fix ==== The problem is fixed in 2 steps: 1.) The Dump thread limit to read event is increased to the upper limit i.e. Dump thread reads whatever gets logged in the binary log. 2.) On the slave side we increase the the max_allowed_packet for the slave's threads (IO/SQL) by increasing it to 1GB. This is done using the new server option (slave_max_allowed_packet) included, is used to regulate the max_allowed_packet of the slave thread (IO/SQL) by the DBA, and facilitates the sending of large packets from the master to the slave. This causes the large packets to be received by the slave and apply it successfully.
This commit is contained in:
@ -9,7 +9,7 @@ change master to master_log_pos=MASTER_LOG_POS;
|
||||
Read_Master_Log_Pos = '75'
|
||||
start slave;
|
||||
include/wait_for_slave_io_error.inc [errno=1236]
|
||||
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master''
|
||||
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event''
|
||||
include/stop_slave_sql.inc
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
|
@ -1,7 +1,7 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
call mtr.add_suppression("Slave I/O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153");
|
||||
call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log:");
|
||||
call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, Error_code: 1153");
|
||||
call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet");
|
||||
drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
|
||||
create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
|
||||
SET @@global.max_allowed_packet=1024;
|
||||
@ -30,14 +30,14 @@ include/start_slave.inc
|
||||
CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
|
||||
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
|
||||
include/wait_for_slave_io_error.inc [errno=1153]
|
||||
Last_IO_Error = 'Got a packet bigger than 'max_allowed_packet' bytes'
|
||||
Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes'
|
||||
include/stop_slave_sql.inc
|
||||
include/rpl_reset.inc
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
|
||||
INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
|
||||
include/wait_for_slave_io_error.inc [errno=1236]
|
||||
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master''
|
||||
include/wait_for_slave_io_error.inc [errno=1153]
|
||||
Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes'
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
RESET MASTER;
|
||||
@ -52,6 +52,7 @@ SET @@global.max_allowed_packet= 1024;
|
||||
Warnings:
|
||||
Warning 1105 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
|
||||
SET @@global.net_buffer_length= 1024;
|
||||
SET @@global.slave_max_allowed_packet= 1073741824;
|
||||
DROP TABLE t1;
|
||||
RESET SLAVE;
|
||||
include/rpl_end.inc
|
||||
|
@ -1 +1 @@
|
||||
-O max_allowed_packet=1024 -O net_buffer_length=1024
|
||||
-O max_allowed_packet=1024 -O net_buffer_length=1024 -O slave_max_allowed_packet=1024
|
||||
|
@ -11,9 +11,8 @@
|
||||
# max-out size db name
|
||||
source include/master-slave.inc;
|
||||
source include/have_binlog_format_row.inc;
|
||||
call mtr.add_suppression("Slave I/O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153");
|
||||
call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log:");
|
||||
|
||||
call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, Error_code: 1153");
|
||||
call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet");
|
||||
let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
|
||||
disable_warnings;
|
||||
eval drop database if exists $db;
|
||||
@ -23,6 +22,7 @@ eval create database $db;
|
||||
connection master;
|
||||
let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`;
|
||||
let $old_net_buffer_length= `SELECT @@global.net_buffer_length`;
|
||||
let $old_slave_max_allowed_packet= `SELECT @@global.slave_max_allowed_packet`;
|
||||
SET @@global.max_allowed_packet=1024;
|
||||
SET @@global.net_buffer_length=1024;
|
||||
|
||||
@ -124,8 +124,8 @@ INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), R
|
||||
|
||||
connection slave;
|
||||
# The slave I/O thread must stop after receiving
|
||||
# 1236=ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master.
|
||||
--let $slave_io_errno= 1236
|
||||
# 1153 = ER_NET_PACKET_TOO_LARGE
|
||||
--let $slave_io_errno= 1153
|
||||
--let $show_slave_io_error= 1
|
||||
--source include/wait_for_slave_io_error.inc
|
||||
|
||||
@ -166,6 +166,7 @@ connection master;
|
||||
DROP TABLE t1;
|
||||
eval SET @@global.max_allowed_packet= $old_max_allowed_packet;
|
||||
eval SET @@global.net_buffer_length= $old_net_buffer_length;
|
||||
eval SET @@global.slave_max_allowed_packet= $old_slave_max_allowed_packet;
|
||||
# slave is stopped
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
|
Reference in New Issue
Block a user