mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-30949 Direct leak in binlog_online_alter_end_trans
when committing a big transaction, online_alter_cache_log creates a cache file. It wasn't properly closed, which was spotted by a memory leak from my_register_filename. A temporary file also remained open. Binlog wasn't affected by this, since it features its own file management. A proper closing is calling close_cached_file. It deinits io_cache and closes the underlying file. After closing, the file is expected to be deleted automagically.
This commit is contained in:
committed by
Sergei Golubchik
parent
0695f7dd7b
commit
ecb9db4c3d
@ -1296,6 +1296,22 @@ connection default;
|
||||
select * from t;
|
||||
a b c
|
||||
drop table t;
|
||||
#
|
||||
# MDEV-30949 Direct leak in binlog_online_alter_end_trans
|
||||
#
|
||||
create table t (f longblob default null) engine=myisam;
|
||||
insert into t values (null);
|
||||
set debug_sync= "alter_table_copy_end signal copy wait_for goon";
|
||||
set debug_sync= "alter_table_online_before_lock signal lock wait_for end";
|
||||
alter table t force, algorithm=copy;
|
||||
connection con1;
|
||||
set debug_sync= "now wait_for copy";
|
||||
insert into t select repeat('a',130000);
|
||||
set debug_sync= "now signal goon wait_for lock";
|
||||
insert into t select repeat('a',130000);
|
||||
set debug_sync= "now signal end";
|
||||
connection default;
|
||||
drop table t;
|
||||
set debug_sync= reset;
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
|
@ -1475,6 +1475,30 @@ dec $i;
|
||||
let local_engine=aria;
|
||||
}
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-30949 Direct leak in binlog_online_alter_end_trans
|
||||
--echo #
|
||||
create table t (f longblob default null) engine=myisam;
|
||||
insert into t values (null);
|
||||
|
||||
set debug_sync= "alter_table_copy_end signal copy wait_for goon";
|
||||
set debug_sync= "alter_table_online_before_lock signal lock wait_for end";
|
||||
|
||||
send alter table t force, algorithm=copy;
|
||||
|
||||
--connection con1
|
||||
set debug_sync= "now wait_for copy";
|
||||
insert into t select repeat('a',130000);
|
||||
set debug_sync= "now signal goon wait_for lock";
|
||||
insert into t select repeat('a',130000);
|
||||
set debug_sync= "now signal end";
|
||||
|
||||
|
||||
--connection default
|
||||
--reap
|
||||
drop table t;
|
||||
|
||||
|
||||
set debug_sync= reset;
|
||||
--disconnect con1
|
||||
--disconnect con2
|
||||
|
Reference in New Issue
Block a user