Commit 8b51d344 authored by Jan Lindström's avatar Jan Lindström Committed by Julius Goryavsky

MDEV-34640 : galera_var_ignore_apply_errors test freezes

Test improvements only to make test more robust.
Signed-off-by: default avatarJulius Goryavsky <julius.goryavsky@mariadb.com>
parent 71f289e5
......@@ -16,4 +16,3 @@ galera_sequences : MDEV-32561 WSREP FSM failure: no such a transition REPLICATIN
galera_concurrent_ctas : MDEV-32779 galera_concurrent_ctas: assertion in the galera::ReplicatorSMM::finish_cert()
galera_as_slave_replay : MDEV-32780 galera_as_slave_replay: assertion in the wsrep::transaction::before_rollback()
galera_slave_replay : MDEV-32780 galera_as_slave_replay: assertion in the wsrep::transaction::before_rollback()
galera_var_ignore_apply_errors : MENT-1997 galera_var_ignore_apply_errors test freezes
......@@ -7,27 +7,60 @@ SET GLOBAL wsrep_on = OFF;
CREATE TABLE t1 (f1 INTEGER);
SET GLOBAL wsrep_on = ON;
DROP TABLE t1;
connection node_2;
SHOW TABLES;
Tables_in_test
connection node_1;
SET GLOBAL wsrep_on = OFF;
CREATE SCHEMA s1;
SET GLOBAL wsrep_on = ON;
DROP SCHEMA s1;
connection node_2;
SHOW SCHEMAS;
Database
information_schema
mtr
mysql
performance_schema
test
connection node_1;
CREATE TABLE t1 (f1 INTEGER);
SET GLOBAL wsrep_on = OFF;
CREATE INDEX idx1 ON t1 (f1);
SET GLOBAL wsrep_on = ON;
DROP INDEX idx1 ON t1;
connection node_2;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER);
SET GLOBAL wsrep_on = OFF;
CREATE INDEX idx1 ON t1 (f1);
SET GLOBAL wsrep_on = ON;
ALTER TABLE t1 DROP INDEX idx1;
connection node_2;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER);
SET GLOBAL wsrep_on = OFF;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
SET GLOBAL wsrep_on = ON;
ALTER TABLE t1 DROP COLUMN f2;
connection node_2;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
connection node_2;
SET GLOBAL wsrep_ignore_apply_errors = 2;
......@@ -37,12 +70,11 @@ SET GLOBAL wsrep_on = OFF;
INSERT INTO t1 VALUES (1);
SET GLOBAL wsrep_on = ON;
DELETE FROM t1 WHERE f1 = 1;
connection node_1;
SELECT COUNT(*) as expect_0 FROM t1;
SELECT COUNT(*) AS expect_0 FROM t1;
expect_0
0
connection node_2;
SELECT COUNT(*) as expect_0 FROM t1;
SELECT COUNT(*) AS expect_0 FROM t1;
expect_0
0
DROP TABLE t1;
......@@ -57,12 +89,11 @@ INSERT INTO t1 VALUES (3);
DELETE FROM t1 WHERE f1 = 1;
DELETE FROM t1 WHERE f1 = 2;
COMMIT;
connection node_1;
SELECT COUNT(*) as expect_1 FROM t1;
SELECT COUNT(*) AS expect_1 FROM t1;
expect_1
1
connection node_2;
SELECT COUNT(*) as expect_1 FROM t1;
SELECT COUNT(*) AS expect_1 FROM t1;
expect_1
1
DROP TABLE t1;
......@@ -75,14 +106,14 @@ DELETE FROM t1 WHERE f1 = 3;
SET SESSION wsrep_on = ON;
connection node_1;
DELETE FROM t1;
SELECT COUNT(*) as expect_0 FROM t1;
SELECT COUNT(*) AS expect_0 FROM t1;
expect_0
0
connection node_2;
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
SELECT COUNT(*) as expect_0 FROM t1;
SELECT VARIABLE_VALUE expect_Primary FROM performance_schema.global_status WHERE VARIABLE_NAME = 'wsrep_cluster_status';
expect_Primary
Primary
SELECT COUNT(*) AS expect_0 FROM t1;
expect_0
0
DROP TABLE t1;
......@@ -103,14 +134,14 @@ DELETE FROM t1 WHERE f1 = 4;
DELETE FROM t1 WHERE f1 = 5;
COMMIT;
SET AUTOCOMMIT=ON;
SELECT COUNT(*) as expect_0 FROM t1;
SELECT COUNT(*) AS expect_0 FROM t1;
expect_0
0
connection node_2;
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
SELECT COUNT(*) as expect_0 FROM t1;
SELECT VARIABLE_VALUE expect_Primary FROM performance_schema.global_status WHERE VARIABLE_NAME = 'wsrep_cluster_status';
expect_Primary
Primary
SELECT COUNT(*) AS expect_0 FROM t1;
expect_0
0
DROP TABLE t1;
......@@ -126,14 +157,14 @@ DELETE FROM t1 WHERE f1 = 3;
SET SESSION wsrep_on = ON;
connection node_1;
DELETE t1, t2 FROM t1 JOIN t2 WHERE t1.f1 = t2.f1;
SELECT COUNT(*) as expect_0 FROM t1;
SELECT COUNT(*) expect_0 FROM t1;
expect_0
0
connection node_2;
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 'Primary' FROM performance_schema.global_status WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
SELECT COUNT(*) as expect_0 FROM t1;
SELECT COUNT(*) expect_0 FROM t1;
expect_0
0
DROP TABLE t1,t2;
......@@ -148,20 +179,20 @@ DELETE FROM child WHERE parent_id = 2;
SET SESSION wsrep_on = ON;
connection node_1;
DELETE FROM parent;
SELECT COUNT(*) as expect_0 FROM parent;
SELECT COUNT(*) AS expect_0 FROM parent;
expect_0
0
SELECT COUNT(*) as expect_0 FROM child;
SELECT COUNT(*) AS expect_0 FROM child;
expect_0
0
connection node_2;
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 'Primary' FROM performance_schema.global_status WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
SELECT COUNT(*) as expect_0 FROM parent;
SELECT COUNT(*) AS expect_0 FROM parent;
expect_0
0
SELECT COUNT(*) as expect_0 FROM child;
SELECT COUNT(*) AS expect_0 FROM child;
expect_0
0
DROP TABLE child, parent;
......@@ -175,8 +206,10 @@ connection node_1;
CREATE TABLE t1 (f1 INTEGER, f2 INTEGER);
DROP TABLE t1;
connection node_2;
SELECT * FROM t1;
ERROR 42S02: Table 'test.t1' doesn't exist
SET GLOBAL wsrep_ignore_apply_errors = 7;
CALL mtr.add_suppression("Can't find record in 't.*'");
CALL mtr.add_suppression("Can't find record in ");
CALL mtr.add_suppression("Slave SQL: Could not execute Delete_rows event");
CALL mtr.add_suppression("Slave SQL: Error 'Unknown table 'test\\.t1'' on query\\. Default database: 'test'\\. Query: 'DROP TABLE t1', Error_code: 1051");
CALL mtr.add_suppression("Slave SQL: Error 'Can't drop database 's1'; database doesn't exist' on query\\. Default database: 'test'\\. Query: 'DROP SCHEMA s1', Error_code: 1008");
......
!include ../galera_2nodes.cnf
[mysqld.1]
wsrep_debug=1
[mysqld.2]
[mysqld]
wsrep_debug=1
wsrep_sync_wait=15
loose-galera-var-ignore-apply-errors=1
......@@ -3,7 +3,7 @@
#
--source include/galera_cluster.inc
--source include/force_restart.inc
#
# Ignore reconciling DDL errors on node_2
......@@ -17,41 +17,55 @@ SET GLOBAL wsrep_ignore_apply_errors = 1;
SET GLOBAL wsrep_on = OFF;
CREATE TABLE t1 (f1 INTEGER);
SET GLOBAL wsrep_on = ON;
--source include/galera_wait_ready.inc
DROP TABLE t1;
--connection node_2
SHOW TABLES;
# Drop schema that does not exist
--connection node_1
SET GLOBAL wsrep_on = OFF;
CREATE SCHEMA s1;
SET GLOBAL wsrep_on = ON;
--source include/galera_wait_ready.inc
DROP SCHEMA s1;
--connection node_2
SHOW SCHEMAS;
# Drop index that does not exist using DROP INDEX
--connection node_1
CREATE TABLE t1 (f1 INTEGER);
SET GLOBAL wsrep_on = OFF;
CREATE INDEX idx1 ON t1 (f1);
SET GLOBAL wsrep_on = ON;
--source include/galera_wait_ready.inc
DROP INDEX idx1 ON t1;
--connection node_2
SHOW CREATE TABLE t1;
DROP TABLE t1;
# Drop index that does not exist using ALTER TABLE
--connection node_1
CREATE TABLE t1 (f1 INTEGER);
SET GLOBAL wsrep_on = OFF;
CREATE INDEX idx1 ON t1 (f1);
SET GLOBAL wsrep_on = ON;
--source include/galera_wait_ready.inc
ALTER TABLE t1 DROP INDEX idx1;
--connection node_2
SHOW CREATE TABLE t1;
DROP TABLE t1;
# Drop column that does not exist
--connection node_1
CREATE TABLE t1 (f1 INTEGER);
SET GLOBAL wsrep_on = OFF;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
SET GLOBAL wsrep_on = ON;
--source include/galera_wait_ready.inc
ALTER TABLE t1 DROP COLUMN f2;
--connection node_2
SHOW CREATE TABLE t1;
DROP TABLE t1;
......@@ -68,21 +82,11 @@ CREATE TABLE t1 (f1 INTEGER);
SET GLOBAL wsrep_on = OFF;
INSERT INTO t1 VALUES (1);
SET GLOBAL wsrep_on = ON;
--source include/galera_wait_ready.inc
DELETE FROM t1 WHERE f1 = 1;
SELECT COUNT(*) AS expect_0 FROM t1;
--connection node_1
--let $wait_condition = SELECT COUNT(*) = 0 FROM t1;
--source include/wait_condition.inc
SELECT COUNT(*) as expect_0 FROM t1;
--connection node_2
--source include/galera_wait_ready.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 0 FROM t1;
--source include/wait_condition.inc
SELECT COUNT(*) as expect_0 FROM t1;
SELECT COUNT(*) AS expect_0 FROM t1;
DROP TABLE t1;
# Delete row that does not exist in a multi statement transaction
......@@ -92,25 +96,15 @@ INSERT INTO t1 VALUES (2);
SET GLOBAL wsrep_on = OFF;
INSERT INTO t1 VALUES (1);
SET GLOBAL wsrep_on = ON;
--source include/galera_wait_ready.inc
START TRANSACTION;
INSERT INTO t1 VALUES (3);
DELETE FROM t1 WHERE f1 = 1;
DELETE FROM t1 WHERE f1 = 2;
COMMIT;
SELECT COUNT(*) AS expect_1 FROM t1;
--connection node_1
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
--source include/wait_condition.inc
SELECT COUNT(*) as expect_1 FROM t1;
--connection node_2
--source include/galera_wait_ready.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
--source include/wait_condition.inc
SELECT COUNT(*) as expect_1 FROM t1;
SELECT COUNT(*) AS expect_1 FROM t1;
DROP TABLE t1;
#
......@@ -127,21 +121,16 @@ INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
SET SESSION wsrep_on = OFF;
DELETE FROM t1 WHERE f1 = 3;
SET SESSION wsrep_on = ON;
--source include/galera_wait_ready.inc
--connection node_1
DELETE FROM t1;
SELECT COUNT(*) AS expect_0 FROM t1;
SELECT COUNT(*) as expect_0 FROM t1;
--connection node_2
--source include/galera_wait_ready.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
--let $wait_condition = SELECT COUNT(*) = 0 FROM t1;
--source include/wait_condition.inc
SELECT COUNT(*) as expect_0 FROM t1;
SELECT VARIABLE_VALUE expect_Primary FROM performance_schema.global_status WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT COUNT(*) AS expect_0 FROM t1;
DROP TABLE t1;
#
......@@ -158,10 +147,8 @@ INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
SET SESSION wsrep_on = OFF;
DELETE FROM t1 WHERE f1 = 3;
SET SESSION wsrep_on = ON;
--source include/galera_wait_ready.inc
--connection node_1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
DELETE FROM t1 WHERE f1 = 1;
......@@ -171,18 +158,13 @@ DELETE FROM t1 WHERE f1 = 4;
DELETE FROM t1 WHERE f1 = 5;
COMMIT;
SET AUTOCOMMIT=ON;
SELECT COUNT(*) AS expect_0 FROM t1;
SELECT COUNT(*) as expect_0 FROM t1;
--connection node_2
--source include/galera_wait_ready.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
--let $wait_condition = SELECT COUNT(*) = 0 FROM t1;
--source include/wait_condition.inc
SELECT COUNT(*) as expect_0 FROM t1;
SELECT VARIABLE_VALUE expect_Primary FROM performance_schema.global_status WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT COUNT(*) AS expect_0 FROM t1;
DROP TABLE t1;
#
......@@ -203,22 +185,16 @@ SET SESSION wsrep_on = OFF;
DELETE FROM t2 WHERE f1 = 2;
DELETE FROM t1 WHERE f1 = 3;
SET SESSION wsrep_on = ON;
--source include/galera_wait_ready.inc
--connection node_1
DELETE t1, t2 FROM t1 JOIN t2 WHERE t1.f1 = t2.f1;
SELECT COUNT(*) as expect_0 FROM t1;
SELECT COUNT(*) expect_0 FROM t1;
--connection node_2
--source include/galera_wait_ready.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
--let $wait_condition = SELECT COUNT(*) = 0 FROM t1;
--source include/wait_condition.inc
SELECT COUNT(*) as expect_0 FROM t1;
SELECT VARIABLE_VALUE = 'Primary' FROM performance_schema.global_status WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT COUNT(*) expect_0 FROM t1;
DROP TABLE t1,t2;
#
......@@ -238,26 +214,18 @@ INSERT INTO child VALUES (1,1),(2,2),(3,3);
SET SESSION wsrep_on = OFF;
DELETE FROM child WHERE parent_id = 2;
SET SESSION wsrep_on = ON;
--source include/galera_wait_ready.inc
--connection node_1
DELETE FROM parent;
SELECT COUNT(*) as expect_0 FROM parent;
SELECT COUNT(*) as expect_0 FROM child;
SELECT COUNT(*) AS expect_0 FROM parent;
SELECT COUNT(*) AS expect_0 FROM child;
--connection node_2
--source include/galera_wait_ready.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
--let $wait_condition = SELECT COUNT(*) = 0 FROM parent;
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 0 FROM child;
--source include/wait_condition.inc
SELECT COUNT(*) as expect_0 FROM parent;
SELECT COUNT(*) as expect_0 FROM child;
SELECT VARIABLE_VALUE = 'Primary' FROM performance_schema.global_status WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT COUNT(*) AS expect_0 FROM parent;
SELECT COUNT(*) AS expect_0 FROM child;
DROP TABLE child, parent;
#
......@@ -272,15 +240,17 @@ SET GLOBAL wsrep_ignore_apply_errors = 4;
SET GLOBAL wsrep_on = OFF;
CREATE TABLE t1 (f1 INTEGER);
SET GLOBAL wsrep_on = ON;
--source include/galera_wait_ready.inc
--connection node_1
CREATE TABLE t1 (f1 INTEGER, f2 INTEGER);
DROP TABLE t1;
--connection node_2
--error ER_NO_SUCH_TABLE
SELECT * FROM t1;
SET GLOBAL wsrep_ignore_apply_errors = 7;
CALL mtr.add_suppression("Can't find record in 't.*'");
CALL mtr.add_suppression("Can't find record in ");
CALL mtr.add_suppression("Slave SQL: Could not execute Delete_rows event");
CALL mtr.add_suppression("Slave SQL: Error 'Unknown table 'test\\.t1'' on query\\. Default database: 'test'\\. Query: 'DROP TABLE t1', Error_code: 1051");
CALL mtr.add_suppression("Slave SQL: Error 'Can't drop database 's1'; database doesn't exist' on query\\. Default database: 'test'\\. Query: 'DROP SCHEMA s1', Error_code: 1008");
......
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