Commit 83196a7b authored by Alexey Yurchenko's avatar Alexey Yurchenko Committed by Julius Goryavsky

Add a basic MTR test for DDL error voting to ensure that all DDLs

generate consistent error messages,
Signed-off-by: default avatarJulius Goryavsky <julius.goryavsky@mariadb.com>
parent 731a5aba
connection node_2;
connection node_1;
connection node_1;
SET @@global.wsrep_ignore_apply_errors = 7;
connection node_2;
SET @@global.wsrep_ignore_apply_errors = 7;
connection node_1;
CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY);
connection node_1;
DROP TABLE nonexistent;
ERROR 42S02: Unknown table 'test.nonexistent'
INSERT INTO t1 VALUES (DEFAULT);
connection node_2;
connection node_1;
TRUNCATE TABLE nonexistent;
ERROR 42S02: Table 'test.nonexistent' doesn't exist
INSERT INTO t1 VALUES (DEFAULT);
connection node_2;
connection node_1;
CREATE TABLE nonexistent.t1 (s INT);
ERROR 42000: Unknown database 'nonexistent'
INSERT INTO t1 VALUES (DEFAULT);
connection node_2;
connection node_1;
CREATE TABLE t1 (s INT);
ERROR 42S01: Table 't1' already exists
INSERT INTO t1 VALUES (DEFAULT);
connection node_2;
connection node_1;
ALTER TABLE nonexistent ADD COLUMN (c INT);
ERROR 42S02: Table 'test.nonexistent' doesn't exist
INSERT INTO t1 VALUES (DEFAULT);
connection node_2;
DROP TABLE t1;
connection node_1;
SET @@global.wsrep_ignore_apply_errors = 0;
connection node_2;
SET @@global.wsrep_ignore_apply_errors = 0;
connection node_1;
CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY);
connection node_1;
DROP TABLE nonexistent;
ERROR 42S02: Unknown table 'test.nonexistent'
INSERT INTO t1 VALUES (DEFAULT);
connection node_2;
connection node_1;
TRUNCATE TABLE nonexistent;
ERROR 42S02: Table 'test.nonexistent' doesn't exist
INSERT INTO t1 VALUES (DEFAULT);
connection node_2;
connection node_1;
CREATE TABLE nonexistent.t1 (s INT);
ERROR 42000: Unknown database 'nonexistent'
INSERT INTO t1 VALUES (DEFAULT);
connection node_2;
connection node_1;
CREATE TABLE t1 (s INT);
ERROR 42S01: Table 't1' already exists
INSERT INTO t1 VALUES (DEFAULT);
connection node_2;
connection node_1;
ALTER TABLE nonexistent ADD COLUMN (c INT);
ERROR 42S02: Table 'test.nonexistent' doesn't exist
INSERT INTO t1 VALUES (DEFAULT);
connection node_2;
DROP TABLE t1;
connection node_1;
SET @@global.wsrep_ignore_apply_errors = 7;
connection node_2;
SET @@global.wsrep_ignore_apply_errors = 7;
--connection node_1
CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY);
--connection node_1
--error 1051
DROP TABLE nonexistent;
# Verify cluster is intact
INSERT INTO t1 VALUES (DEFAULT);
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
--source include/wait_condition.inc
--connection node_1
--error 1146
TRUNCATE TABLE nonexistent;
# Verify cluster is intact
INSERT INTO t1 VALUES (DEFAULT);
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 2 FROM t1;
--source include/wait_condition.inc
--connection node_1
--error 1049
CREATE TABLE nonexistent.t1 (s INT);
# Verify cluster is intact
INSERT INTO t1 VALUES (DEFAULT);
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 3 FROM t1;
--source include/wait_condition.inc
--connection node_1
--error 1050
CREATE TABLE t1 (s INT);
# Verify cluster is intact
INSERT INTO t1 VALUES (DEFAULT);
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
--source include/wait_condition.inc
--connection node_1
--error 1146
ALTER TABLE nonexistent ADD COLUMN (c INT);
# Verify cluster is intact
INSERT INTO t1 VALUES (DEFAULT);
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 5 FROM t1;
--source include/wait_condition.inc
DROP TABLE t1;
#
# Test voting on identical DDL errors (error messages should match)
#
--source include/galera_cluster.inc
--source include/have_binlog_format_row.inc
#
# 1. Ignore all DDL errors (avoids voting)
#
--connection node_1
--let $wsrep_ignore_apply_errors_saved1 = `SELECT @@global.wsrep_ignore_apply_errors`
SET @@global.wsrep_ignore_apply_errors = 7;
--connection node_2
--let $wsrep_ignore_apply_errors_saved2 = `SELECT @@global.wsrep_ignore_apply_errors`
SET @@global.wsrep_ignore_apply_errors = 7;
--source galera_vote_ddl.inc
#
# 2. Don't ignore any errors (forces voting)
#
--connection node_1
SET @@global.wsrep_ignore_apply_errors = 0;
--connection node_2
SET @@global.wsrep_ignore_apply_errors = 0;
--source galera_vote_ddl.inc
--connection node_1
--eval SET @@global.wsrep_ignore_apply_errors = $wsrep_ignore_apply_errors_saved1
--connection node_2
--eval SET @@global.wsrep_ignore_apply_errors = $wsrep_ignore_apply_errors_saved2
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