summaryrefslogtreecommitdiff
path: root/mysql-test/suite/galera
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2022-10-04 14:08:36 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2022-10-09 10:09:47 +0300
commite8acec89741777ebaf46b499fdfe191ad88c3a95 (patch)
tree39439ea1b3b29ed34e86d9c4f63ebdda047c7958 /mysql-test/suite/galera
parentab3ec013c41db1b9943c5e34d3d44a35fa7538fb (diff)
downloadmariadb-git-e8acec89741777ebaf46b499fdfe191ad88c3a95.tar.gz
MDEV-26597 : Assertion `!wsrep_has_changes(thd) || (thd->lex->sql_command == SQLCOM_CREATE_TABLE && !thd->is_current_stmt_binlog_format_row())' failed.
If repl.max_ws_size is set too low following CREATE TABLE could fail during commit. In this case wsrep_commit_empty should allow rolling it back if provider state is s_aborted. Furhermore, original ER_ERROR_DURING_COMMIT does not really tell anything clear for user. Therefore, this commit adds a new error ER_TOO_BIG_WRITESET. This will change some test cases output.
Diffstat (limited to 'mysql-test/suite/galera')
-rw-r--r--mysql-test/suite/galera/r/MDEV-26597.result19
-rw-r--r--mysql-test/suite/galera/r/galera_repl_max_ws_size.result2
-rw-r--r--mysql-test/suite/galera/r/galera_var_max_ws_size.result2
-rw-r--r--mysql-test/suite/galera/t/MDEV-26597.test32
-rw-r--r--mysql-test/suite/galera/t/galera_repl_max_ws_size.test2
-rw-r--r--mysql-test/suite/galera/t/galera_var_max_ws_size.test2
6 files changed, 55 insertions, 4 deletions
diff --git a/mysql-test/suite/galera/r/MDEV-26597.result b/mysql-test/suite/galera/r/MDEV-26597.result
new file mode 100644
index 00000000000..76730b56db1
--- /dev/null
+++ b/mysql-test/suite/galera/r/MDEV-26597.result
@@ -0,0 +1,19 @@
+connection node_2;
+connection node_1;
+connection node_1;
+connection node_2;
+connection node_2;
+CREATE TABLE t3 (c1 INTEGER NOT NULL PRIMARY KEY, c2 FLOAT(3,2));
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512';
+SET @@autocommit=0;
+INSERT INTO t3 VALUES (1000,0.00),(1001,0.25),(1002,0.50),(1003,0.75),(1008,1.00),(1009,1.25),(1010,1.50),(1011,1.75);
+CREATE TABLE t1 ( pk int primary key) ENGINE=INNODB;
+ERROR HY000: Maximum writeset size exceeded
+SHOW WARNINGS;
+Level Code Message
+Error 4160 Maximum writeset size exceeded
+connection node_2;
+SET SESSION wsrep_sync_wait = 0;
+Killing server ...
+connection node_1;
+DROP TABLE t3;
diff --git a/mysql-test/suite/galera/r/galera_repl_max_ws_size.result b/mysql-test/suite/galera/r/galera_repl_max_ws_size.result
index 0528df7b9f6..343381b99ea 100644
--- a/mysql-test/suite/galera/r/galera_repl_max_ws_size.result
+++ b/mysql-test/suite/galera/r/galera_repl_max_ws_size.result
@@ -4,7 +4,7 @@ connection node_1;
CREATE TABLE t1 (f1 VARCHAR(512)) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512';
INSERT INTO t1 VALUES (REPEAT('a', 512));
-ERROR HY000: Got error 5 "Input/output error" during COMMIT
+ERROR HY000: Maximum writeset size exceeded
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
diff --git a/mysql-test/suite/galera/r/galera_var_max_ws_size.result b/mysql-test/suite/galera/r/galera_var_max_ws_size.result
index 89c9698eed4..bd712ef9b55 100644
--- a/mysql-test/suite/galera/r/galera_var_max_ws_size.result
+++ b/mysql-test/suite/galera/r/galera_var_max_ws_size.result
@@ -4,7 +4,7 @@ connection node_1;
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 VARCHAR(1024)) Engine=InnoDB;
SET GLOBAL wsrep_max_ws_size = 1024;
INSERT INTO t1 VALUES (DEFAULT, REPEAT('X', 1024));
-ERROR HY000: Got error 5 "Input/output error" during COMMIT
+ERROR HY000: Maximum writeset size exceeded
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
diff --git a/mysql-test/suite/galera/t/MDEV-26597.test b/mysql-test/suite/galera/t/MDEV-26597.test
new file mode 100644
index 00000000000..3162cefcc22
--- /dev/null
+++ b/mysql-test/suite/galera/t/MDEV-26597.test
@@ -0,0 +1,32 @@
+--source include/galera_cluster.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--connection node_2
+CREATE TABLE t3 (c1 INTEGER NOT NULL PRIMARY KEY, c2 FLOAT(3,2));
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512';
+SET @@autocommit=0;
+INSERT INTO t3 VALUES (1000,0.00),(1001,0.25),(1002,0.50),(1003,0.75),(1008,1.00),(1009,1.25),(1010,1.50),(1011,1.75);
+--error ER_TOO_BIG_WRITESET
+CREATE TABLE t1 ( pk int primary key) ENGINE=INNODB;
+SHOW WARNINGS;
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+--source include/kill_galera.inc
+
+--let $start_mysqld_params = ""
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+--source include/start_mysqld.inc
+
+#
+# Cleanup
+#
+--source ../../galera/include/auto_increment_offset_restore.inc
+--connection node_1
+DROP TABLE t3;
+
+
diff --git a/mysql-test/suite/galera/t/galera_repl_max_ws_size.test b/mysql-test/suite/galera/t/galera_repl_max_ws_size.test
index 60b866ae018..896ad99f3d8 100644
--- a/mysql-test/suite/galera/t/galera_repl_max_ws_size.test
+++ b/mysql-test/suite/galera/t/galera_repl_max_ws_size.test
@@ -12,7 +12,7 @@ CREATE TABLE t1 (f1 VARCHAR(512)) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512';
---error ER_ERROR_DURING_COMMIT
+--error ER_TOO_BIG_WRITESET
INSERT INTO t1 VALUES (REPEAT('a', 512));
SELECT COUNT(*) = 0 FROM t1;
diff --git a/mysql-test/suite/galera/t/galera_var_max_ws_size.test b/mysql-test/suite/galera/t/galera_var_max_ws_size.test
index 8eb93bda9be..440b3dea2a3 100644
--- a/mysql-test/suite/galera/t/galera_var_max_ws_size.test
+++ b/mysql-test/suite/galera/t/galera_var_max_ws_size.test
@@ -12,7 +12,7 @@ CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 VARCHAR(1024)) Engine
--let $wsrep_max_ws_size_orig = `SELECT @@wsrep_max_ws_size`
SET GLOBAL wsrep_max_ws_size = 1024;
---error ER_ERROR_DURING_COMMIT
+--error ER_TOO_BIG_WRITESET
INSERT INTO t1 VALUES (DEFAULT, REPEAT('X', 1024));
SELECT COUNT(*) = 0 FROM t1;