Commit 836a352b authored by Jan Lindström's avatar Jan Lindström

MDEV-22666 : galera.MW-328A MTR failed: "Semaphore wait has lasted > 600...

MDEV-22666 : galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002

Removed bad tests.
parent c796c266
......@@ -12,8 +12,6 @@
GCF-1081 : MDEV-18283 Galera test failure on galera.GCF-1081
GCF-939 : MDEV-21520 galera.GCF-939
MW-328A : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002
MW-328B : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002
MW-329 : MDEV-19962 Galera test failure on MW-329
galera_as_slave_ctas : MDEV-28378 timeout
galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event()
......
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
INSERT INTO t1 (f1) VALUES (1);
CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
CREATE PROCEDURE proc_update ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
END WHILE;
END|
connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1X;
CALL proc_update();;
connection node_1;
call mtr.add_suppression("WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position");
connection node_2;
call mtr.add_suppression("WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position");
SET SESSION wsrep_retry_autocommit = 0;
connection node_1;
connection node_1X;
Got one of the listed errors
connection node_1;
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
CALL mtr.add_suppression("conflict state ABORTED after post commit");
connection node_1;
CREATE TABLE t1 (i int primary key, j int) engine=innodb;
INSERT INTO t1 values (1,0);
BEGIN;
UPDATE t1 SET j=1 WHERE i=1;
connection node_2;
UPDATE t1 SET j=2 WHERE i=1;
connection node_1;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SELECT * FROM t1;
i j
1 2
connection node_2;
SELECT * FROM t1;
i j
1 2
connection node_1;
DROP TABLE t1;
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
INSERT INTO t1 (f1) VALUES (1);
CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
CREATE PROCEDURE proc_update ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
END WHILE;
END|
connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1X;
CALL proc_update();;
connection node_2;
SET SESSION wsrep_retry_autocommit = 0;
connection node_1;
connection node_1X;
Got one of the listed errors
connection node_1;
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
CALL mtr.add_suppression("conflict state ABORTED after post commit");
connection node_2;
connection node_1;
CREATE TABLE t1 (i INT) ENGINE = InnoDB;
INSERT INTO t1 (i) VALUES(1);
CREATE TABLE t2 (i INT) ENGINE = InnoDB;
connection node_1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
SELECT * FROM t1 WHERE i = 1 LOCK IN SHARE MODE;
i
1
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1a;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT IGNORE INTO t2 SELECT * FROM t1 WHERE i = 1 FOR UPDATE;;
connection node_1;
DELETE FROM t1 WHERE i = 1;
COMMIT;
connection node_1a;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t1, t2;
connection node_2;
connection node_1;
create table t1 (i int primary key, j int) engine=innodb;
create table t2 (i int primary key, j int) engine=innodb;
insert into t1 values (1,0);
insert into t2 values (2,0);
set autocommit=off;
start transaction;
update t1 set j=1 where i=1;
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1a;
set autocommit=off;
start transaction;
begin;
update t2 set j=1 where i=2;
connection node_1;
insert into t1 select * from t2;;
connection node_1a;
insert into t2 select * from t1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_1;
DROP TABLE t1, t2;
#
# Cleanup for MW-328 tests
#
--connection node_1
--disable_query_log
--eval KILL CONNECTION $sp_connection_id
--enable_query_log
--connection node_1X
--error 2013,1317
--reap
--connection node_1
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
CALL mtr.add_suppression("conflict state ABORTED after post commit");
#
# Initialization for MW-328 tests
#
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
INSERT INTO t1 (f1) VALUES (1);
CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
#
# Have some random updates going on against t1
#
DELIMITER |;
CREATE PROCEDURE proc_update ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
END WHILE;
END|
DELIMITER ;|
--connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_1X
--let $sp_connection_id = `SELECT CONNECTION_ID()`
--send CALL proc_update();
!include ../galera_2nodes.cnf
[mysqld.1]
wsrep-debug=SERVER
[mysqld.2]
wsrep-debug=SERVER
#
# MW-328 Fix unnecessary/silent BF aborts
#
#
# test phase 1 is not deterministic
#
# Here we attempt to insert into t2 and check if insert actually
# inserted rows if a success was reported.
#
# However, deadlocks may or may not happen in this test execution
# it all depends on timing.
#
--source include/galera_cluster.inc
--source include/force_restart.inc
--source suite/galera/t/MW-328-header.inc
--connection node_1
call mtr.add_suppression("WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position");
--connection node_2
call mtr.add_suppression("WSREP: Wait for gtid returned error 3 while waiting for prior transactions to commit before setting position");
--let $count = 100
--let $successes = 0
--let $deadlocks = 0
SET SESSION wsrep_retry_autocommit = 0;
--disable_query_log
while ($count)
{
TRUNCATE TABLE t2;
--error 0,ER_LOCK_DEADLOCK
INSERT IGNORE INTO t2 SELECT f2 FROM t1;
if ($mysql_errno != 1213) {
--inc $successes
if (`SELECT COUNT(*) = 0 FROM t2`) {
--die No rows arrived in table t2
}
}
if ($mysql_errno == 1213) {
--inc $deadlocks
}
--dec $count
}
--enable_query_log
--source suite/galera/t/MW-328-footer.inc
#
# Test phase 2 is deterministic
# Here we generate a sure conflict in node 1 and verify that
# insert failed in both nodes
#
--connection node_1
CREATE TABLE t1 (i int primary key, j int) engine=innodb;
INSERT INTO t1 values (1,0);
BEGIN;
UPDATE t1 SET j=1 WHERE i=1;
--connection node_2
UPDATE t1 SET j=2 WHERE i=1;
--connection node_1
--error ER_LOCK_DEADLOCK
COMMIT;
SELECT * FROM t1;
--connection node_2
SELECT * FROM t1;
--connection node_1
DROP TABLE t1;
!include ../galera_2nodes.cnf
[mysqld.1]
wsrep-debug=SERVER
[mysqld.2]
wsrep-debug=SERVER
#
# MW-328 Fix unnecessary/silent BF aborts
#
#
# Make sure an unrelated SELECT following a BF-aborted query never
# gets the deadlock error
#
--source include/galera_cluster.inc
--source include/force_restart.inc
--source suite/galera/t/MW-328-header.inc
--connection node_2
--let $count = 100
SET SESSION wsrep_retry_autocommit = 0;
--disable_query_log
while ($count)
{
--error 0,1213
INSERT IGNORE INTO t2 SELECT f2 FROM t1;
--disable_result_log
--error 0
SELECT 1 FROM DUAL;
--enable_result_log
--dec $count
}
--enable_query_log
--source suite/galera/t/MW-328-footer.inc
!include ../galera_2nodes.cnf
[mysqld.1]
wsrep-debug=SERVER
[mysqld.2]
wsrep-debug=SERVER
#
# MW-328 Fix unnecessary/silent BF aborts
#
#
# Test that non-Galera deadlock error still behaves as expected
#
--source include/galera_cluster.inc
CREATE TABLE t1 (i INT) ENGINE = InnoDB;
INSERT INTO t1 (i) VALUES(1);
CREATE TABLE t2 (i INT) ENGINE = InnoDB;
# Create a deadlock situation
--connection node_1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
SELECT * FROM t1 WHERE i = 1 LOCK IN SHARE MODE;
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_1a
SET AUTOCOMMIT=OFF;
START TRANSACTION;
--send INSERT IGNORE INTO t2 SELECT * FROM t1 WHERE i = 1 FOR UPDATE;
--connection node_1
--sleep 2
DELETE FROM t1 WHERE i = 1;
COMMIT;
# We expect that ER_LOCK_DEADLOCK will be delivered even though it was a INSERT INGORE statement
--connection node_1a
--error ER_LOCK_DEADLOCK
--reap
DROP TABLE t1, t2;
!include ../galera_2nodes.cnf
[mysqld.1]
wsrep-debug=SERVER
[mysqld.2]
wsrep-debug=SERVER
#
# MW-328 Fix unnecessary/silent BF aborts
#
#
# Test that non-Galera deadlock error still behaves as expected (case #2)
#
--source include/galera_cluster.inc
create table t1 (i int primary key, j int) engine=innodb;
create table t2 (i int primary key, j int) engine=innodb;
insert into t1 values (1,0);
insert into t2 values (2,0);
set autocommit=off;
start transaction;
update t1 set j=1 where i=1;
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_1a
set autocommit=off;
start transaction;
begin;
update t2 set j=1 where i=2;
--connection node_1
# Hang expected here
--send insert into t1 select * from t2;
--sleep 2
--connection node_1a
--error ER_LOCK_DEADLOCK
insert into t2 select * from t1;
--connection node_1
--reap
DROP TABLE t1, t2;
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