mirror of
https://github.com/MariaDB/server.git
synced 2025-02-12 00:15:35 +01:00
![Jan Lindström](/assets/img/avatar_default.png)
Add wait_condition between debug sync SIGNAL points and other expected state conditions and refactor actual sync point for easier to use in test case. Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
68 lines
1.8 KiB
Text
68 lines
1.8 KiB
Text
connection node_2;
|
|
connection node_1;
|
|
connection node_1;
|
|
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=innodb;
|
|
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=innodb;
|
|
INSERT INTO t1 VALUES (1, 'a');
|
|
INSERT INTO t1 VALUES (2, 'a');
|
|
SET AUTOCOMMIT=ON;
|
|
START TRANSACTION;
|
|
UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
|
|
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
|
connection node_1a;
|
|
SET SESSION wsrep_sync_wait=0;
|
|
LOCK TABLE t2 WRITE;
|
|
connection node_1;
|
|
SET DEBUG_SYNC= 'wsrep_before_mdl_wait SIGNAL before_mdl_wait WAIT_FOR mdl_wait_continue';
|
|
SELECT * FROM t2;;
|
|
connection node_1a;
|
|
# Wait until select is blocked before MDL lock wait
|
|
SET DEBUG_SYNC= 'now WAIT_FOR before_mdl_wait';
|
|
connection node_1a;
|
|
SET @@debug_dbug = "d,sync.wsrep_after_BF_victim_lock";
|
|
connection node_2;
|
|
UPDATE t1 SET f2 = 'c' WHERE f1 = 1;
|
|
connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
|
connection node_1b;
|
|
SET SESSION wsrep_sync_wait=0;
|
|
# Wait for conflicting update to block
|
|
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock";
|
|
connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
|
connection node_1c;
|
|
connection node_1a;
|
|
SET DEBUG_SYNC = "now SIGNAL BF_victim_continue";
|
|
UNLOCK TABLES;
|
|
connection node_1;
|
|
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
|
connection node_1;
|
|
SELECT COUNT(*) AS EXPECT_1 FROM t1 WHERE f2 = 'a';
|
|
EXPECT_1
|
|
1
|
|
SELECT COUNT(*) AS EXPECT_1 FROM t1 WHERE f2 = 'c';
|
|
EXPECT_1
|
|
1
|
|
SELECT * FROM t1;
|
|
f1 f2
|
|
1 c
|
|
2 a
|
|
connection node_2;
|
|
SELECT COUNT(*) AS EXPECT_1 FROM t1 WHERE f2 = 'a';
|
|
EXPECT_1
|
|
1
|
|
SELECT COUNT(*) AS EXPECT_1 FROM t1 WHERE f2 = 'c';
|
|
EXPECT_1
|
|
1
|
|
SELECT * FROM t1;
|
|
f1 f2
|
|
1 c
|
|
2 a
|
|
DROP TABLE t1;
|
|
DROP TABLE t2;
|
|
connection node_1a;
|
|
SET DEBUG_SYNC = "RESET";
|
|
connection node_1b;
|
|
SET DEBUG_SYNC = "RESET";
|
|
connection node_1;
|
|
disconnect node_1a;
|
|
disconnect node_1b;
|
|
disconnect node_1c;
|