Commit 3e89b4fc authored by Vlad Lesin's avatar Vlad Lesin

MDEV-31570 gap_lock_split.test hangs sporadically

The fix is in replacing the waiting for the whole purge finishing
with the the waiting for only delete-marked records purging finishing.

Reviewed by: Marko Mäkelä
parent 687fd6be
SET @save_frequency=@@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
CREATE TABLE t1(id INT PRIMARY key, val VARCHAR(16000)) ENGINE=InnoDB;
CREATE TABLE t1(id INT PRIMARY key, val VARCHAR(16000))
ENGINE=InnoDB STATS_PERSISTENT=0;
INSERT INTO t1 (id,val) SELECT 2*seq,'x' FROM seq_0_to_1023;
connect con1,localhost,root,,;
InnoDB 0 transactions not purged
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
DELETE FROM t1 WHERE id=1788;
SET @saved_dbug = @@GLOBAL.debug_dbug;
SET @@GLOBAL.debug_dbug="d,enable_row_purge_del_mark_exit_sync_point";
BEGIN;
SELECT * FROM t1 WHERE id=1788 FOR UPDATE;
id val
connection con1;
COMMIT;
InnoDB 0 transactions not purged
SET DEBUG_SYNC = 'now WAIT_FOR row_purge_del_mark_finished';
SET @@GLOBAL.debug_dbug = @saved_dbug;
connection default;
INSERT INTO t1 (id,val) VALUES (1787, REPEAT('x',2000));
connection con1;
......
--source include/have_innodb.inc
--source include/have_sequence.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
SET @save_frequency=@@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
CREATE TABLE t1(id INT PRIMARY key, val VARCHAR(16000)) ENGINE=InnoDB;
CREATE TABLE t1(id INT PRIMARY key, val VARCHAR(16000))
ENGINE=InnoDB STATS_PERSISTENT=0;
INSERT INTO t1 (id,val) SELECT 2*seq,'x' FROM seq_0_to_1023;
connect(con1,localhost,root,,);
......@@ -16,13 +18,18 @@ connection default;
DELETE FROM t1 WHERE id=1788;
SET @saved_dbug = @@GLOBAL.debug_dbug;
SET @@GLOBAL.debug_dbug="d,enable_row_purge_del_mark_exit_sync_point";
BEGIN;
# This will return no result, but should acquire a gap lock.
SELECT * FROM t1 WHERE id=1788 FOR UPDATE;
connection con1;
COMMIT;
source include/wait_all_purged.inc;
SET DEBUG_SYNC = 'now WAIT_FOR row_purge_del_mark_finished';
SET @@GLOBAL.debug_dbug = @saved_dbug;
connection default;
INSERT INTO t1 (id,val) VALUES (1787, REPEAT('x',2000));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment