mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
BUG#30435 loading large LOAD DATA INFILE breaks slave with
read_buffer_size set on master BUG#33413 show binlog events fails if binlog has event size of close to max_allowed_packet The size of Append_block replication event was determined solely by read_buffer_size whereas the rest of replication code deals with max_allowed_packet. When the former parameter was set to larger than the latter there were two artifacts: the master could not read events from binlog; show master events did not show. Fixed with - fragmenting the used io-cached buffer into pieces each size of less than max_allowed_packet (bug#30435) - incrementing show-binlog-events handling thread's max_allowed_packet with the max estimated for the replication header size include/my_sys.h: accessor-macros added in order not to mess with the io cache's implementation details in code that merely exploits the io-cache. sql/sql_repl.cc: BUG#33413: incrementing thd->variables.max_allowed_packet with the max estimation for the replication header size (from bug#19402); refactoring log_loaded_block() to fragment the io_cache buffer in case read_buffer_size > max_allowed_packet. mysql-test/r/rpl_loaddata_map.result: New BitKeeper file ``mysql-test/r/rpl_loaddata_map.result'' mysql-test/t/rpl_loaddata_map-master.opt: specific options to trigger BUG#30435, BUG#33413 situations mysql-test/t/rpl_loaddata_map-slave.opt: max_allowed_packet to be compatible with the master's version. mysql-test/t/rpl_loaddata_map.test: regression tests for two bugs.
This commit is contained in:
31
mysql-test/r/rpl_loaddata_map.result
Normal file
31
mysql-test/r/rpl_loaddata_map.result
Normal file
@ -0,0 +1,31 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
create table t2 (id int not null primary key auto_increment);
|
||||
show variables like 'max_allowed_packet' /* 8K */;
|
||||
Variable_name Value
|
||||
max_allowed_packet 7168
|
||||
show variables like 'read_buffer_size' /* 9K */;
|
||||
Variable_name Value
|
||||
read_buffer_size 8228
|
||||
load data infile '/home/elkin/MySQL/TEAM/FIXES/5.0/bug33435-load_data_read_buffer_size/mysql-test/var/tmp/bug30435_5k.txt' into table t2;
|
||||
select count(*) from t2 /* 5 000 */;
|
||||
count(*)
|
||||
5000
|
||||
show binlog events in 'master-bin.000002' from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000002 98 Query 1 # use `test`; create table t2 (id int not null primary key auto_increment)
|
||||
master-bin.000002 221 Begin_load_query 1 # ;file_id=1;block_len=7168
|
||||
master-bin.000002 7412 Append_block 1 # ;file_id=1;block_len=7168
|
||||
master-bin.000002 14603 Append_block 1 # ;file_id=1;block_len=2048
|
||||
master-bin.000002 16674 Append_block 1 # ;file_id=1;block_len=7168
|
||||
master-bin.000002 23865 Append_block 1 # ;file_id=1;block_len=341
|
||||
master-bin.000002 24229 Execute_load_query 1 # use `test`; load data infile '/home/elkin/MySQL/TEAM/FIXES/5.0/bug33435-load_data_read_buffer_size/mysql-test/var/tmp/bug30435_5k.txt' into table t2 ;file_id=1
|
||||
select count(*) from t2 /* 5 000 */;
|
||||
count(*)
|
||||
5000
|
||||
drop table t1, t2;
|
||||
end of the tests
|
Reference in New Issue
Block a user