mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-32614 LeakSanitizer errors in copy_data_between_tables
The memory leak occurs on error when backup_reset_alter_copy_lock fails with timeout. This leads to the alter rollback, but flush_unused is not called. Move table flushing on error handling to a single place and mind more possible failures this time.
This commit is contained in:
@ -2066,6 +2066,41 @@ select * from t1;
|
||||
drop table t1;
|
||||
|
||||
|
||||
--echo # MDEV-32614 LeakSanitizer errors in copy_data_between_tables
|
||||
create table t (a int, b int) engine=aria;
|
||||
insert into t select seq, seq from seq_1_to_5;
|
||||
backup stage start;
|
||||
|
||||
--connect (con_lock,localhost,root,,)
|
||||
set lock_wait_timeout= 1;
|
||||
|
||||
set debug_sync='copy_data_between_tables_before_reset_backup_lock wait_for continue';
|
||||
send alter table t add index (b), algorithm=copy, lock=none;
|
||||
|
||||
--connection default
|
||||
backup stage block_commit;
|
||||
|
||||
set debug_sync='now signal continue';
|
||||
|
||||
--connection con_lock
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
--reap
|
||||
# --echo # error $mysql_errno
|
||||
|
||||
set debug_sync='copy_data_between_tables_before_reset_backup_lock wait_for continue';
|
||||
send alter table t add index (a), algorithm=copy, lock=none;
|
||||
|
||||
--connection default
|
||||
backup stage end;
|
||||
set debug_sync='now signal continue';
|
||||
|
||||
--connection con_lock
|
||||
--reap
|
||||
--disconnect con_lock
|
||||
--connection default
|
||||
drop table t;
|
||||
|
||||
|
||||
eval set global default_storage_engine= $default_storage_engine;
|
||||
|
||||
--disconnect con1
|
||||
|
Reference in New Issue
Block a user