From 024e95128ba59a365c7b30858bd207bb59504662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 3 Sep 2024 12:11:05 +0300 Subject: [PATCH] MDEV-32996 : galera.galera_var_ignore_apply_errors -> [ERROR] WSREP: Inconsistency detected Add wait_until_ready waits after wsrep_on is set on again to make sure that node is ready for next step before continuing. Signed-off-by: Julius Goryavsky --- .../r/galera_var_ignore_apply_errors.result | 5 ++++- .../galera/t/galera_var_ignore_apply_errors.cnf | 2 +- .../galera/t/galera_var_ignore_apply_errors.test | 15 ++++++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/galera/r/galera_var_ignore_apply_errors.result b/mysql-test/suite/galera/r/galera_var_ignore_apply_errors.result index ea8510581bb..17b06017287 100644 --- a/mysql-test/suite/galera/r/galera_var_ignore_apply_errors.result +++ b/mysql-test/suite/galera/r/galera_var_ignore_apply_errors.result @@ -208,7 +208,9 @@ DROP TABLE t1; connection node_2; SELECT * FROM t1; ERROR 42S02: Table 'test.t1' doesn't exist -SET GLOBAL wsrep_ignore_apply_errors = 7; +SET GLOBAL wsrep_ignore_apply_errors = 10; +Warnings: +Warning 1292 Truncated incorrect wsrep_ignore_apply_errors value: '10' 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"); @@ -217,3 +219,4 @@ CALL mtr.add_suppression("Slave SQL: Error 'Can't DROP 'idx1'; check that column CALL mtr.add_suppression("Slave SQL: Error 'Can't DROP 'idx1'; check that column/key exists' on query\\. Default database: 'test'\\. Query: 'ALTER TABLE t1 DROP INDEX idx1', Error_code: 1091"); CALL mtr.add_suppression("Slave SQL: Error 'Can't DROP 'f2'; check that column/key exists' on query\\. Default database: 'test'\\. Query: 'ALTER TABLE t1 DROP COLUMN f2', Error_code: 1091"); CALL mtr.add_suppression("Slave SQL: Error 'Table 't1' already exists' on query\\."); +CALL mtr.add_suppression("Inconsistency detected: Inconsistent by consensus on "); diff --git a/mysql-test/suite/galera/t/galera_var_ignore_apply_errors.cnf b/mysql-test/suite/galera/t/galera_var_ignore_apply_errors.cnf index 1d02401decc..fdb73f1f052 100644 --- a/mysql-test/suite/galera/t/galera_var_ignore_apply_errors.cnf +++ b/mysql-test/suite/galera/t/galera_var_ignore_apply_errors.cnf @@ -2,5 +2,5 @@ [mysqld] wsrep_debug=1 -wsrep_sync_wait=15 +wsrep_sync_wait=0 loose-galera-var-ignore-apply-errors=1 diff --git a/mysql-test/suite/galera/t/galera_var_ignore_apply_errors.test b/mysql-test/suite/galera/t/galera_var_ignore_apply_errors.test index d5c6521add4..e5c13dddd29 100644 --- a/mysql-test/suite/galera/t/galera_var_ignore_apply_errors.test +++ b/mysql-test/suite/galera/t/galera_var_ignore_apply_errors.test @@ -17,6 +17,7 @@ SET GLOBAL wsrep_ignore_apply_errors = 1; SET GLOBAL wsrep_on = OFF; CREATE TABLE t1 (f1 INTEGER); SET GLOBAL wsrep_on = ON; +--source include/wait_until_ready.inc DROP TABLE t1; --connection node_2 @@ -27,6 +28,7 @@ SHOW TABLES; SET GLOBAL wsrep_on = OFF; CREATE SCHEMA s1; SET GLOBAL wsrep_on = ON; +--source include/wait_until_ready.inc DROP SCHEMA s1; --connection node_2 @@ -38,6 +40,7 @@ CREATE TABLE t1 (f1 INTEGER); SET GLOBAL wsrep_on = OFF; CREATE INDEX idx1 ON t1 (f1); SET GLOBAL wsrep_on = ON; +--source include/wait_until_ready.inc DROP INDEX idx1 ON t1; --connection node_2 @@ -50,6 +53,7 @@ CREATE TABLE t1 (f1 INTEGER); SET GLOBAL wsrep_on = OFF; CREATE INDEX idx1 ON t1 (f1); SET GLOBAL wsrep_on = ON; +--source include/wait_until_ready.inc ALTER TABLE t1 DROP INDEX idx1; --connection node_2 @@ -62,6 +66,7 @@ CREATE TABLE t1 (f1 INTEGER); SET GLOBAL wsrep_on = OFF; ALTER TABLE t1 ADD COLUMN f2 INTEGER; SET GLOBAL wsrep_on = ON; +--source include/wait_until_ready.inc ALTER TABLE t1 DROP COLUMN f2; --connection node_2 @@ -82,6 +87,7 @@ CREATE TABLE t1 (f1 INTEGER); SET GLOBAL wsrep_on = OFF; INSERT INTO t1 VALUES (1); SET GLOBAL wsrep_on = ON; +--source include/wait_until_ready.inc DELETE FROM t1 WHERE f1 = 1; SELECT COUNT(*) AS expect_0 FROM t1; @@ -96,6 +102,7 @@ INSERT INTO t1 VALUES (2); SET GLOBAL wsrep_on = OFF; INSERT INTO t1 VALUES (1); SET GLOBAL wsrep_on = ON; +--source include/wait_until_ready.inc START TRANSACTION; INSERT INTO t1 VALUES (3); DELETE FROM t1 WHERE f1 = 1; @@ -121,6 +128,7 @@ 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/wait_until_ready.inc --connection node_1 DELETE FROM t1; @@ -147,6 +155,7 @@ 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/wait_until_ready.inc --connection node_1 SET AUTOCOMMIT=OFF; @@ -185,6 +194,7 @@ SET SESSION wsrep_on = OFF; DELETE FROM t2 WHERE f1 = 2; DELETE FROM t1 WHERE f1 = 3; SET SESSION wsrep_on = ON; +--source include/wait_until_ready.inc --connection node_1 DELETE t1, t2 FROM t1 JOIN t2 WHERE t1.f1 = t2.f1; @@ -214,6 +224,7 @@ 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/wait_until_ready.inc --connection node_1 DELETE FROM parent; @@ -240,6 +251,7 @@ SET GLOBAL wsrep_ignore_apply_errors = 4; SET GLOBAL wsrep_on = OFF; CREATE TABLE t1 (f1 INTEGER); SET GLOBAL wsrep_on = ON; +--source include/wait_until_ready.inc --connection node_1 CREATE TABLE t1 (f1 INTEGER, f2 INTEGER); @@ -248,7 +260,7 @@ DROP TABLE t1; --connection node_2 --error ER_NO_SUCH_TABLE SELECT * FROM t1; -SET GLOBAL wsrep_ignore_apply_errors = 7; +SET GLOBAL wsrep_ignore_apply_errors = 10; CALL mtr.add_suppression("Can't find record in "); CALL mtr.add_suppression("Slave SQL: Could not execute Delete_rows event"); @@ -258,3 +270,4 @@ CALL mtr.add_suppression("Slave SQL: Error 'Can't DROP 'idx1'; check that column CALL mtr.add_suppression("Slave SQL: Error 'Can't DROP 'idx1'; check that column/key exists' on query\\. Default database: 'test'\\. Query: 'ALTER TABLE t1 DROP INDEX idx1', Error_code: 1091"); CALL mtr.add_suppression("Slave SQL: Error 'Can't DROP 'f2'; check that column/key exists' on query\\. Default database: 'test'\\. Query: 'ALTER TABLE t1 DROP COLUMN f2', Error_code: 1091"); CALL mtr.add_suppression("Slave SQL: Error 'Table 't1' already exists' on query\\."); +CALL mtr.add_suppression("Inconsistency detected: Inconsistent by consensus on ");