mirror of
https://github.com/MariaDB/server.git
synced 2025-08-21 16:03:24 +03:00
Split the test case so that a server restart is not needed. Reduce the test cases and use a simpler mechanism for triggering and waiting for purge. fil_table_accessible(): Check if a table can be accessed without enjoying MDL protection.
67 lines
1.6 KiB
Plaintext
67 lines
1.6 KiB
Plaintext
--source include/have_innodb.inc
|
|
--source include/have_debug.inc
|
|
--source include/have_debug_sync.inc
|
|
--source include/count_sessions.inc
|
|
|
|
--echo #
|
|
--echo # Bug #23070734 CONCURRENT TRUNCATE TABLES CAUSE STALLS
|
|
--echo #
|
|
|
|
create table t1 (f1 int ,f2 int,key(f2)) engine=innodb;
|
|
begin;
|
|
insert into t1 values (10,45),(20,78),(30,88),(40,23),(50,78),(60,11),(70,56),(80,90);
|
|
delete from t1;
|
|
|
|
connect (con2,localhost,root,,);
|
|
# Stop the purge thread
|
|
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
|
|
|
connection default;
|
|
# Ensure that the history list length will actually be decremented by purge.
|
|
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
|
|
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
|
|
commit;
|
|
|
|
connect (con1,localhost,root,,);
|
|
SET DEBUG_SYNC= 'buffer_pool_scan SIGNAL started WAIT_FOR finish_scan';
|
|
send truncate table t1;
|
|
|
|
connection con2;
|
|
SET DEBUG_SYNC= 'now WAIT_FOR started';
|
|
# Allow purge to proceed, by discarding our read view.
|
|
COMMIT;
|
|
disconnect con2;
|
|
|
|
connection default;
|
|
|
|
# Wait for everything to be purged.
|
|
|
|
let $wait_counter= 300;
|
|
while ($wait_counter)
|
|
{
|
|
--replace_regex /.*History list length ([0-9]+).*/\1/
|
|
let $remaining= `SHOW ENGINE INNODB STATUS`;
|
|
if ($remaining == 'InnoDB 0')
|
|
{
|
|
let $wait_counter= 0;
|
|
}
|
|
if ($wait_counter)
|
|
{
|
|
real_sleep 0.1;
|
|
dec $wait_counter;
|
|
}
|
|
}
|
|
echo $remaining transactions not purged;
|
|
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
|
|
|
|
SET DEBUG_SYNC = 'now SIGNAL finish_scan';
|
|
SET DEBUG_SYNC = 'RESET';
|
|
|
|
connection con1;
|
|
reap;
|
|
disconnect con1;
|
|
|
|
connection default;
|
|
drop table t1;
|
|
--source include/wait_until_count_sessions.inc
|