mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
Fixes/improvements in galera test suite
This commit is contained in:
parent
1b7c5dedf7
commit
8b09db8bfb
10 changed files with 131 additions and 78 deletions
|
@ -0,0 +1,35 @@
|
|||
# See auto_increment_offset_restore.inc for details.
|
||||
|
||||
if (!$node_1)
|
||||
{
|
||||
--die ERROR IN TEST: $node_1 must be set before sourcing auto_increment_offset_save.inc
|
||||
}
|
||||
|
||||
if (!$node_2)
|
||||
{
|
||||
--die ERROR IN TEST: $node_2 must be set before sourcing auto_increment_offset_save.inc
|
||||
}
|
||||
|
||||
if (!$auto_increment_offset_node_1)
|
||||
{
|
||||
--die ERROR IN TEST: $auto_increment_offset_node_1 must be set before sourcing auto_increment_offset_save.inc
|
||||
}
|
||||
|
||||
if (!$auto_increment_offset_node_2)
|
||||
{
|
||||
--die ERROR IN TEST: $auto_increment_offset_node_2 must be set before sourcing auto_increment_offset_save.inc
|
||||
}
|
||||
|
||||
# Restore original auto_increment_offset values.
|
||||
--disable_query_log
|
||||
--connection $node_1
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_1;
|
||||
--connection $node_2
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_2;
|
||||
|
||||
if ($node_3)
|
||||
{
|
||||
--connection $node_3
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_3;
|
||||
}
|
||||
--enable_query_log
|
|
@ -0,0 +1,37 @@
|
|||
# This file can be used to save the @@global.auto_increment_offset value at
|
||||
# the beginning of any test that intends to restart any of the participating
|
||||
# nodes. This is required as the node may get auto-assigned a different
|
||||
# auto_increment_offset value on restart, which could cause MTR's internal
|
||||
# post-check to fail. auto_increment_offset_restore.inc can be used at the
|
||||
# end of the test to restore these saved values.
|
||||
|
||||
# Parameters
|
||||
# ----------
|
||||
# $node_1
|
||||
# Connection handle for 1st node
|
||||
# $node_2
|
||||
# Connection handle for 2nd node
|
||||
# $node_3 (optional)
|
||||
# Connection handle for 3rd node
|
||||
|
||||
if (!$node_1)
|
||||
{
|
||||
--die ERROR IN TEST: $node_1 must be set before sourcing auto_increment_offset_save.inc
|
||||
}
|
||||
|
||||
if (!$node_2)
|
||||
{
|
||||
--die ERROR IN TEST: $node_2 must be set before sourcing auto_increment_offset_save.inc
|
||||
}
|
||||
|
||||
--connection $node_1
|
||||
let $auto_increment_offset_node_1 = `SELECT @@global.auto_increment_offset`;
|
||||
--connection $node_2
|
||||
let $auto_increment_offset_node_2 = `SELECT @@global.auto_increment_offset`;
|
||||
|
||||
if ($node_3)
|
||||
{
|
||||
--connection $node_3
|
||||
let $auto_increment_offset_node_3 = `SELECT @@global.auto_increment_offset`;
|
||||
}
|
||||
|
|
@ -10,10 +10,9 @@
|
|||
--source suite/galera/include/galera_have_debug_sync.inc
|
||||
|
||||
# Save original auto_increment_offset values.
|
||||
--connection node_1
|
||||
let $auto_increment_offset_node_1 = `SELECT @@global.auto_increment_offset`;
|
||||
--connection node_2
|
||||
let $auto_increment_offset_node_2 = `SELECT @@global.auto_increment_offset`;
|
||||
--let $node_1=node_1
|
||||
--let $node_2=node_2
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
|
||||
INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a'), (4, 'a'), (5, 'a'),(6, 'a');
|
||||
|
@ -114,10 +113,7 @@ SELECT COUNT(*) = 0 FROM t3;
|
|||
DROP TABLE t1, t2, t3;
|
||||
|
||||
# Restore original auto_increment_offset values.
|
||||
--disable_query_log
|
||||
--connection node_1
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_1;
|
||||
--connection node_2
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_2;
|
||||
--enable_query_log
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
|
||||
--source include/galera_end.inc
|
||||
|
||||
|
|
|
@ -6,10 +6,9 @@
|
|||
--source include/have_innodb.inc
|
||||
|
||||
# Save original auto_increment_offset values.
|
||||
--connection node_1
|
||||
let $auto_increment_offset_node_1 = `SELECT @@global.auto_increment_offset`;
|
||||
--connection node_2
|
||||
let $auto_increment_offset_node_2 = `SELECT @@global.auto_increment_offset`;
|
||||
--let $node_1=node_1
|
||||
--let $node_2=node_2
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
||||
--connection node_1
|
||||
--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
|
||||
|
@ -40,10 +39,8 @@ SET GLOBAL wsrep_cluster_address = '';
|
|||
--source include/start_mysqld.inc
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
--disable_query_log
|
||||
# Restore original auto_increment_offset values.
|
||||
--connection node_1
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_1;
|
||||
--connection node_2
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_2;
|
||||
--enable_query_log
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
|
||||
--source include/galera_end.inc
|
||||
|
||||
|
|
|
@ -6,10 +6,9 @@
|
|||
--source include/have_innodb.inc
|
||||
|
||||
# Save original auto_increment_offset values.
|
||||
--connection node_1
|
||||
let $auto_increment_offset_node_1 = `SELECT @@global.auto_increment_offset`;
|
||||
--connection node_2
|
||||
let $auto_increment_offset_node_2 = `SELECT @@global.auto_increment_offset`;
|
||||
--let $node_1=node_1
|
||||
--let $node_2=node_2
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
||||
--connection node_1
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
|
||||
|
@ -33,11 +32,9 @@ SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_N
|
|||
|
||||
DROP TABLE t1;
|
||||
|
||||
--disable_query_log
|
||||
# Restore original auto_increment_offset values.
|
||||
--connection node_1
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_1;
|
||||
--connection node_2a
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_2;
|
||||
--enable_query_log
|
||||
--let $node_2=node_2a
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
|
||||
--source include/galera_end.inc
|
||||
|
||||
|
|
|
@ -6,17 +6,16 @@
|
|||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
# Save original auto_increment_offset values.
|
||||
--let $node_1=node_1
|
||||
--let $node_2=node_2
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
||||
call mtr.add_suppression("WSREP: TO isolation failed for: ");
|
||||
|
||||
--connection node_1
|
||||
--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
|
||||
|
||||
# Save original auto_increment_offset values.
|
||||
--connection node_1
|
||||
let $auto_increment_offset_node_1 = `SELECT @@global.auto_increment_offset`;
|
||||
--connection node_2
|
||||
let $auto_increment_offset_node_2 = `SELECT @@global.auto_increment_offset`;
|
||||
|
||||
--connection node_2
|
||||
--source include/kill_galera.inc
|
||||
|
||||
|
@ -44,10 +43,8 @@ SET GLOBAL wsrep_cluster_address = '';
|
|||
--source include/wait_until_connected_again.inc
|
||||
|
||||
# Restore original auto_increment_offset values.
|
||||
--disable_query_log
|
||||
--connection node_1
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_1;
|
||||
--connection node_2a
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_2;
|
||||
--enable_query_log
|
||||
--let $node_2=node_2a
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
|
||||
--source include/galera_end.inc
|
||||
|
||||
|
|
|
@ -8,10 +8,9 @@
|
|||
--source include/have_innodb.inc
|
||||
|
||||
# Save original auto_increment_offset values.
|
||||
--connection node_1
|
||||
let $auto_increment_offset_node_1 = `SELECT @@global.auto_increment_offset`;
|
||||
--connection node_2
|
||||
let $auto_increment_offset_node_2 = `SELECT @@global.auto_increment_offset`;
|
||||
--let $node_1=node_1
|
||||
--let $node_2=node_2
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
||||
--connection node_1
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
|
||||
|
@ -56,11 +55,7 @@ SELECT COUNT(*) = 1 FROM t1;
|
|||
|
||||
DROP TABLE t1;
|
||||
|
||||
--disable_query_log
|
||||
# Restore original auto_increment_offset values.
|
||||
--connection node_1
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_1;
|
||||
--connection node_2a
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_2;
|
||||
--enable_query_log
|
||||
--let $node_2=node_2a
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
|
||||
|
|
|
@ -5,13 +5,10 @@
|
|||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--disable_query_log
|
||||
# Save original auto_increment_offset values.
|
||||
--connection node_1
|
||||
let $auto_increment_offset_node_1 = `SELECT @@global.auto_increment_offset`;
|
||||
--connection node_2
|
||||
let $auto_increment_offset_node_2 = `SELECT @@global.auto_increment_offset`;
|
||||
--enable_query_log
|
||||
--let $node_1=node_1
|
||||
--let $node_2=node_2
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
||||
--connection node_2
|
||||
--let $wsrep_cluster_address_saved = `SELECT @@global.wsrep_cluster_address`
|
||||
|
@ -49,13 +46,8 @@ SELECT * FROM t1;
|
|||
# Cleanup
|
||||
DROP TABLE t1;
|
||||
|
||||
--disable_query_log
|
||||
# Restore original auto_increment_offset values.
|
||||
--connection node_1
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_1;
|
||||
--connection node_2
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_2;
|
||||
--enable_query_log
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
|
||||
--source include/galera_end.inc
|
||||
--echo # End of test
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.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_1
|
||||
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
|
@ -36,4 +41,13 @@ if ($galera_wsrep_start_position != $expected_position)
|
|||
DROP TABLE t1;
|
||||
DROP DATABASE db;
|
||||
|
||||
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
# Restore original auto_increment_offset values.
|
||||
--let $node_2=node_2a
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
|
||||
--source include/galera_end.inc
|
||||
|
||||
|
||||
|
|
|
@ -10,12 +10,10 @@
|
|||
--source include/galera_connect.inc
|
||||
|
||||
# Save original auto_increment_offset values.
|
||||
--connection node_1
|
||||
let $auto_increment_offset_node_1 = `SELECT @@global.auto_increment_offset`;
|
||||
--connection node_2
|
||||
let $auto_increment_offset_node_2 = `SELECT @@global.auto_increment_offset`;
|
||||
--connection node_3
|
||||
let $auto_increment_offset_node_3 = `SELECT @@global.auto_increment_offset`;
|
||||
--let $node_1=node_1
|
||||
--let $node_2=node_2
|
||||
--let $node_3=node_3
|
||||
--source ../galera/include/auto_increment_offset_save.inc
|
||||
|
||||
--connection node_1
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
|
||||
|
@ -49,12 +47,7 @@ SELECT COUNT(*) = 2 FROM t1;
|
|||
DROP TABLE t1;
|
||||
|
||||
# Restore original auto_increment_offset values.
|
||||
--disable_query_log
|
||||
--connection node_1
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_1;
|
||||
--connection node_2
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_2;
|
||||
--connection node_3
|
||||
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_3;
|
||||
--enable_query_log
|
||||
--source ../galera/include/auto_increment_offset_restore.inc
|
||||
|
||||
--source include/galera_end.inc
|
||||
|
||||
|
|
Loading…
Reference in a new issue