summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsara <sara.jaakola@gmail.com>2023-01-23 12:09:54 +0200
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2023-05-02 03:42:17 +0200
commit4e942bcd93e961fe9e5ee5502f7817633600db4c (patch)
treee4497a3c5fab4ee11e9f13a8ec0c5240b707614d
parentddcc9d2281de9fa68525a6808e9181bbd6bf98e0 (diff)
downloadmariadb-git-4e942bcd93e961fe9e5ee5502f7817633600db4c.tar.gz
MDEV-30414 sporadic failures with galera var retry autocommit
changed tast case 2 to be deterministic Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
-rw-r--r--mysql-test/suite/galera/r/galera_var_retry_autocommit.result12
-rw-r--r--mysql-test/suite/galera/t/galera_var_retry_autocommit.test19
2 files changed, 29 insertions, 2 deletions
diff --git a/mysql-test/suite/galera/r/galera_var_retry_autocommit.result b/mysql-test/suite/galera/r/galera_var_retry_autocommit.result
index 56c2c995402..50667b0a4fa 100644
--- a/mysql-test/suite/galera/r/galera_var_retry_autocommit.result
+++ b/mysql-test/suite/galera/r/galera_var_retry_autocommit.result
@@ -20,17 +20,25 @@ DROP TABLE t1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
SET SESSION wsrep_retry_autocommit = 1;
+SET GLOBAL debug_dbug = '+d,sync.wsrep_retry_autocommit';
SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continue';
INSERT INTO t1 (f1) VALUES (3);
connection node_1a;
SET DEBUG_SYNC = 'now WAIT_FOR before_cert';
connection node_2;
TRUNCATE TABLE t1;
-connection node_1;
+connection node_1a;
+SET DEBUG_SYNC = 'now WAIT_FOR wsrep_retry_autocommit_reached';
SELECT COUNT(*) FROM t1;
COUNT(*)
0
+SET DEBUG_SYNC = 'now SIGNAL wsrep_retry_autocommit_continue';
+connection node_1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
SET DEBUG_SYNC = 'RESET';
+SET GLOBAL debug_dbug = NULL;
DROP TABLE t1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
@@ -64,6 +72,8 @@ SET SESSION wsrep_retry_autocommit = 64;
SET GLOBAL debug_dbug = '+d,sync.wsrep_retry_autocommit';
SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continue EXECUTE 64';
INSERT INTO t1 VALUES (5);
+connection node_2;
+connection node_1;
connection node_1;
SELECT COUNT(*) FROM t1;
COUNT(*)
diff --git a/mysql-test/suite/galera/t/galera_var_retry_autocommit.test b/mysql-test/suite/galera/t/galera_var_retry_autocommit.test
index bd10e448e06..c58eba1410e 100644
--- a/mysql-test/suite/galera/t/galera_var_retry_autocommit.test
+++ b/mysql-test/suite/galera/t/galera_var_retry_autocommit.test
@@ -25,6 +25,8 @@ SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continu
SET DEBUG_SYNC = 'now WAIT_FOR before_cert';
--connection node_2
+--let $wait_condition = SELECT count(*)=1 FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'
+--source include/wait_condition.inc
TRUNCATE TABLE t1;
--connection node_1
@@ -44,6 +46,7 @@ DROP TABLE t1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
SET SESSION wsrep_retry_autocommit = 1;
+SET GLOBAL debug_dbug = '+d,sync.wsrep_retry_autocommit';
SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continue';
--send INSERT INTO t1 (f1) VALUES (3)
@@ -51,14 +54,21 @@ SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continu
SET DEBUG_SYNC = 'now WAIT_FOR before_cert';
--connection node_2
+--let $wait_condition = SELECT count(*)=1 FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'
+--source include/wait_condition.inc
TRUNCATE TABLE t1;
+--connection node_1a
+SET DEBUG_SYNC = 'now WAIT_FOR wsrep_retry_autocommit_reached';
+SELECT COUNT(*) FROM t1;
+SET DEBUG_SYNC = 'now SIGNAL wsrep_retry_autocommit_continue';
+
--connection node_1
---error 0,ER_LOCK_DEADLOCK
--reap
SELECT COUNT(*) FROM t1;
SET DEBUG_SYNC = 'RESET';
+SET GLOBAL debug_dbug = NULL;
DROP TABLE t1;
@@ -79,6 +89,8 @@ SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continu
SET DEBUG_SYNC = 'now WAIT_FOR before_cert';
--connection node_2
+--let $wait_condition = SELECT count(*)=1 FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'
+--source include/wait_condition.inc
TRUNCATE TABLE t1;
--connection node_1a
@@ -114,6 +126,11 @@ SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continu
--send INSERT INTO t1 VALUES (5)
+--connection node_2
+--let $wait_condition = SELECT count(*)=1 FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'
+--source include/wait_condition.inc
+
+--connection node_1
--disable_query_log
--disable_result_log
--let $count = 64