Commit 7730b7ba authored by Jan Lindström's avatar Jan Lindström

MDEV-23617 : galera_sr.galera_sr_rollback_retry MTR failed: 1213: Deadlock...

MDEV-23617 : galera_sr.galera_sr_rollback_retry MTR failed: 1213: Deadlock found when trying to get lock

Add corrected wait_condition to wait until rows are in streaming
replication log.
parent af834c21
...@@ -11,10 +11,11 @@ INSERT INTO t1 VALUES (3); ...@@ -11,10 +11,11 @@ INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4); INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5); INSERT INTO t1 VALUES (5);
connection node_2; connection node_2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
connection node_1; connection node_1;
ROLLBACK; ROLLBACK;
connection node_2; connection node_2;
SELECT * FROM t1;
f1
SET AUTOCOMMIT=OFF; SET AUTOCOMMIT=OFF;
START TRANSACTION; START TRANSACTION;
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
...@@ -23,11 +24,11 @@ INSERT INTO t1 VALUES (3); ...@@ -23,11 +24,11 @@ INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4); INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5); INSERT INTO t1 VALUES (5);
COMMIT; COMMIT;
SELECT COUNT(*) = 5 FROM t1; SELECT COUNT(*) AS EXPECT_5 FROM t1;
COUNT(*) = 5 EXPECT_5
1 5
connection node_1; connection node_1;
SELECT COUNT(*) = 5 FROM t1; SELECT COUNT(*) AS EXPECT_5 FROM t1;
COUNT(*) = 5 EXPECT_5
1 5
DROP TABLE t1; DROP TABLE t1;
...@@ -19,8 +19,7 @@ INSERT INTO t1 VALUES (4); ...@@ -19,8 +19,7 @@ INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5); INSERT INTO t1 VALUES (5);
--connection node_2 --connection node_2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; --let $wait_condition = SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log
--let $wait_condition = SELECT COUNT(*) > 0 FROM t1;
--source include/wait_condition.inc --source include/wait_condition.inc
--connection node_1 --connection node_1
...@@ -33,6 +32,7 @@ ROLLBACK; ...@@ -33,6 +32,7 @@ ROLLBACK;
--connection node_2 --connection node_2
--let $wait_condition = SELECT COUNT(*) = 0 FROM t1; --let $wait_condition = SELECT COUNT(*) = 0 FROM t1;
--source include/wait_condition.inc --source include/wait_condition.inc
SELECT * FROM t1;
# #
# It should be possible to reissue the same transaction against node #2 # It should be possible to reissue the same transaction against node #2
...@@ -47,9 +47,11 @@ INSERT INTO t1 VALUES (4); ...@@ -47,9 +47,11 @@ INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5); INSERT INTO t1 VALUES (5);
COMMIT; COMMIT;
SELECT COUNT(*) = 5 FROM t1; SELECT COUNT(*) AS EXPECT_5 FROM t1;
--connection node_1 --connection node_1
SELECT COUNT(*) = 5 FROM t1; --let $wait_condition = SELECT COUNT(*) = 5 FROM t1;
--source include/wait_condition.inc
SELECT COUNT(*) AS EXPECT_5 FROM t1;
DROP TABLE t1; DROP TABLE t1;
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