mirror of
https://github.com/MariaDB/server.git
synced 2025-11-19 19:03:26 +03:00
Problem
========
SQL statements close to the size of max_allowed_packet produce binary
log events larger than 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 + max_event_header
length. Now since the event length exceeds this size master Dump
thread is unable to send the packet on to the slave.
That can happen e.g with row-based replication in Update_rows event.
Fix
====
The problem was fixed by increasing the max_allowed_packet for the
slave's threads (IO/SQL) by increasing it to 1GB.
This is done using the new server option included which is used to
regulate the max_allowed_packet of the slave thread (IO/SQL).
This causes the large packets to be received by the slave and apply
it successfully.
sql/log_event.h:
Added the new option in the log_event.h file.
sql/mysqld.cc:
Added a new option to the server.
sql/slave.cc:
Increasing the session max_allowed_packet to a large value ,
i.e. not taking global(max_allowed) into consideration, for the slave's threads.
41 lines
2.9 KiB
Plaintext
41 lines
2.9 KiB
Plaintext
SET @start_max_allowed_packet= @@global.max_allowed_packet;
|
|
SET @start_value= @@global.net_buffer_length;
|
|
drop table if exists t1;
|
|
## Creating new table t1 ##
|
|
CREATE TABLE t1
|
|
(
|
|
id INT NOT NULL auto_increment,
|
|
PRIMARY KEY (id),
|
|
name BLOB
|
|
);
|
|
'#--------------------FN_DYNVARS_070_01-------------------------#'
|
|
## Setting value of max_allowed packet and net_buffer_length to 1024 ##
|
|
SET @@session.max_allowed_packet = 1024;
|
|
ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
|
|
SELECT @@session.max_allowed_packet;
|
|
@@session.max_allowed_packet
|
|
1048576
|
|
SET @@session.net_buffer_length = 1024;
|
|
ERROR HY000: SESSION variable 'net_buffer_length' is read-only. Use SET GLOBAL to assign the value
|
|
SELECT @@session.net_buffer_length;
|
|
@@session.net_buffer_length
|
|
16384
|
|
'#--------------------FN_DYNVARS_070_02-------------------------#'
|
|
## Setting value of max_allowed packet and net_buffer_length to 1024 ##
|
|
SET @@global.max_allowed_packet = 1024;
|
|
Warnings:
|
|
Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
|
|
SET @@global.net_buffer_length = 1024;
|
|
SELECT @@global.max_allowed_packet;
|
|
@@global.max_allowed_packet
|
|
1024
|
|
SELECT @@global.net_buffer_length;
|
|
@@global.net_buffer_length
|
|
1024
|
|
## Creating new connection test_con1 ##
|
|
## Inserting and fetching data of length greater than 1024 ##
|
|
INSERT into t1(name) values("aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
|
|
drop table t1;
|
|
SET @@global.max_allowed_packet= @start_max_allowed_packet;
|
|
SET @@global.net_buffer_length= @start_value;
|