mariadb/mysql-test/suite/galera/r/galera_var_retry_autocommit.result
Daniele Sciascia 58c03e8f30 MDEV-15794 Fix and re-enable test galera_var_retry_autocommit
The test was not deterministic and would occasionally fail, due to the
use of `sleep`.
This patch is a complete rewrite of the test using proper sync points.
2018-04-26 13:03:51 +02:00

54 lines
1.9 KiB
Text

CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
SET SESSION wsrep_retry_autocommit = 0;
SET DEBUG_SYNC = 'wsrep_before_replication SIGNAL before_rep WAIT_FOR continue';
INSERT INTO t1 (f1) VALUES (2);
SET DEBUG_SYNC = 'now WAIT_FOR before_rep';
TRUNCATE TABLE t1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
SET DEBUG_SYNC = 'RESET';
DROP TABLE t1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
SET SESSION wsrep_retry_autocommit = 1;
SET DEBUG_SYNC = 'wsrep_before_replication SIGNAL before_rep WAIT_FOR continue';
INSERT INTO t1 (f1) VALUES (2);
SET DEBUG_SYNC = 'now WAIT_FOR before_rep';
TRUNCATE TABLE t1;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
SET DEBUG_SYNC = 'RESET';
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_replication SIGNAL before_rep WAIT_FOR continue EXECUTE 2';
INSERT INTO t1 VALUES (2);;
SET DEBUG_SYNC = 'now WAIT_FOR before_rep';
TRUNCATE TABLE t1;
SET DEBUG_SYNC = 'now WAIT_FOR wsrep_retry_autocommit_reached';
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
SET DEBUG_SYNC = 'now SIGNAL wsrep_retry_autocommit_continue WAIT_FOR before_rep';
TRUNCATE TABLE t1;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SET DEBUG_SYNC = 'RESET';
SET GLOBAL debug_dbug = NULL;
DROP TABLE t1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
SET SESSION wsrep_retry_autocommit = 64;
SET GLOBAL debug_dbug = '+d,sync.wsrep_retry_autocommit';
SET DEBUG_SYNC = 'wsrep_before_replication SIGNAL before_rep WAIT_FOR continue EXECUTE 64';
INSERT INTO t1 VALUES (2);
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
SET DEBUG_SYNC = 'RESET';
SET GLOBAL debug_dbug = NULL;
DROP TABLE t1;