mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
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ä
This commit is contained in:
@@ -1,18 +1,22 @@
|
|||||||
SET @save_frequency=@@GLOBAL.innodb_purge_rseg_truncate_frequency;
|
SET @save_frequency=@@GLOBAL.innodb_purge_rseg_truncate_frequency;
|
||||||
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
|
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;
|
INSERT INTO t1 (id,val) SELECT 2*seq,'x' FROM seq_0_to_1023;
|
||||||
connect con1,localhost,root,,;
|
connect con1,localhost,root,,;
|
||||||
InnoDB 0 transactions not purged
|
InnoDB 0 transactions not purged
|
||||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||||
connection default;
|
connection default;
|
||||||
DELETE FROM t1 WHERE id=1788;
|
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;
|
BEGIN;
|
||||||
SELECT * FROM t1 WHERE id=1788 FOR UPDATE;
|
SELECT * FROM t1 WHERE id=1788 FOR UPDATE;
|
||||||
id val
|
id val
|
||||||
connection con1;
|
connection con1;
|
||||||
COMMIT;
|
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;
|
connection default;
|
||||||
INSERT INTO t1 (id,val) VALUES (1787, REPEAT('x',2000));
|
INSERT INTO t1 (id,val) VALUES (1787, REPEAT('x',2000));
|
||||||
connection con1;
|
connection con1;
|
||||||
|
@@ -1,11 +1,13 @@
|
|||||||
--source include/have_innodb.inc
|
--source include/have_innodb.inc
|
||||||
--source include/have_sequence.inc
|
--source include/have_sequence.inc
|
||||||
--source include/have_debug.inc
|
--source include/have_debug.inc
|
||||||
|
--source include/have_debug_sync.inc
|
||||||
|
|
||||||
SET @save_frequency=@@GLOBAL.innodb_purge_rseg_truncate_frequency;
|
SET @save_frequency=@@GLOBAL.innodb_purge_rseg_truncate_frequency;
|
||||||
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
|
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;
|
INSERT INTO t1 (id,val) SELECT 2*seq,'x' FROM seq_0_to_1023;
|
||||||
|
|
||||||
connect(con1,localhost,root,,);
|
connect(con1,localhost,root,,);
|
||||||
@@ -16,13 +18,18 @@ connection default;
|
|||||||
|
|
||||||
DELETE FROM t1 WHERE id=1788;
|
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;
|
BEGIN;
|
||||||
# This will return no result, but should acquire a gap lock.
|
# This will return no result, but should acquire a gap lock.
|
||||||
SELECT * FROM t1 WHERE id=1788 FOR UPDATE;
|
SELECT * FROM t1 WHERE id=1788 FOR UPDATE;
|
||||||
|
|
||||||
connection con1;
|
connection con1;
|
||||||
COMMIT;
|
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;
|
connection default;
|
||||||
|
|
||||||
INSERT INTO t1 (id,val) VALUES (1787, REPEAT('x',2000));
|
INSERT INTO t1 (id,val) VALUES (1787, REPEAT('x',2000));
|
||||||
|
Reference in New Issue
Block a user