1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +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:
Nikita Malyavin
2024-01-02 18:45:43 +01:00
parent c2e16b3ad5
commit 50095046f3
3 changed files with 78 additions and 19 deletions

View File

@ -1807,6 +1807,28 @@ a b
456 NULL
789 NULL
drop table t1;
# 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';
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 HY000: Lock wait timeout exceeded; try restarting transaction
set debug_sync='copy_data_between_tables_before_reset_backup_lock wait_for continue';
alter table t add index (a), algorithm=copy, lock=none;
connection default;
backup stage end;
set debug_sync='now signal continue';
connection con_lock;
disconnect con_lock;
connection default;
drop table t;
set global default_storage_engine= MyISAM;
disconnect con1;
disconnect con2;