mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Galera4
This commit is contained in:
committed by
Sergey Vojtovich
parent
382115b992
commit
36a2a185fe
@@ -103,5 +103,56 @@ cat_file $datadir.tempfiles.txt;
|
||||
remove_file $datadir.tempfiles.txt;
|
||||
list_files $datadir/mysql #sql*;
|
||||
|
||||
#
|
||||
# Check that SHOW ENGINE INNODB STATUS does not show any active transactions
|
||||
# We do this only if wsrep provider is loaded, to avoid disturbing any non-Galera MTR tests
|
||||
#
|
||||
if (`SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'wsrep' AND PLUGIN_STATUS='ACTIVE'`) {
|
||||
if (`SELECT @@wsrep_on`) {
|
||||
if (`SELECT COUNT(*) FROM information_schema.innodb_trx WHERE trx_mysql_thread_id != 0`) {
|
||||
if ($before) {
|
||||
--echo Before test start.
|
||||
}
|
||||
if (!$before) {
|
||||
--echo After test end.
|
||||
}
|
||||
--echo There is one or more active InnoDB transaction(s) when there should be none. Dumping some diagnostics.
|
||||
|
||||
--let $status_locks = `SELECT @@innodb_status_output_locks`
|
||||
--let $status_output = `SELECT @@innodb_status_output`
|
||||
--enable_query_log
|
||||
SET GLOBAL innodb_status_output_locks=ON;
|
||||
SHOW ENGINE INNODB STATUS;
|
||||
--disable_query_log
|
||||
--eval SET GLOBAL innodb_status_output_locks=$status_locks;
|
||||
--eval SET GLOBAL innodb_status_output=$status_output;
|
||||
--enable_query_log
|
||||
|
||||
--vertical_results
|
||||
if ($before) {
|
||||
--replace_regex /$/ /
|
||||
}
|
||||
SELECT * FROM information_schema.processlist;
|
||||
|
||||
if ($before) {
|
||||
--replace_regex /$/ /
|
||||
}
|
||||
SELECT * FROM information_schema.innodb_trx;
|
||||
|
||||
if ($before) {
|
||||
--replace_regex /$/ /
|
||||
}
|
||||
SELECT * FROM information_schema.innodb_locks;
|
||||
|
||||
if ($before) {
|
||||
--replace_regex /$/ /
|
||||
}
|
||||
SELECT * FROM information_schema.innodb_lock_waits;
|
||||
--horizontal_results
|
||||
--disable_query_log
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
--enable_query_log
|
||||
|
||||
|
@@ -8,5 +8,11 @@
|
||||
|
||||
--let $galera_cluster_size = 2
|
||||
--source include/galera_init.inc
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/galera_wait_ready.inc
|
||||
|
||||
--connection node_2
|
||||
--source include/galera_wait_ready.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--connection node_1
|
||||
|
9
mysql-test/include/galera_have_debug_sync.inc
Normal file
9
mysql-test/include/galera_have_debug_sync.inc
Normal file
@@ -0,0 +1,9 @@
|
||||
--disable_query_log
|
||||
|
||||
--let $galera_have_debug_sync = `SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters'`
|
||||
|
||||
--if (!$galera_have_debug_sync) {
|
||||
--skip "Test requires Galera debug library with debug_sync functionality"
|
||||
}
|
||||
|
||||
--enable_query_log
|
@@ -1,6 +1,17 @@
|
||||
--let $wait_timeout = 10
|
||||
--let $wsrep_on_orig = `SELECT @@wsrep_on`
|
||||
SET SESSION wsrep_on = 0;
|
||||
|
||||
#
|
||||
# following is only for debugging purposes
|
||||
# should be commented out when test wporks as planned
|
||||
#
|
||||
#--sleep 1
|
||||
# SHOW PROCESSLIST;
|
||||
#SHOW STATUS LIKE 'wsrep_%';
|
||||
#--echo $galera_sync_point
|
||||
|
||||
--let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = '$galera_sync_point'
|
||||
--source include/wait_condition.inc
|
||||
--eval SET SESSION wsrep_on = $wsrep_on_orig
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
# To be used in a test which requires wsrep plugin to be ACTIVE and enabled
|
||||
# (i.e. wsrep_on=ON). It includes have_wsrep.inc.
|
||||
|
||||
--source include/have_wsrep.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'wsrep_on' AND VARIABLE_VALUE='ON'`)
|
||||
|
20
mysql-test/include/kill_galera.inc
Normal file
20
mysql-test/include/kill_galera.inc
Normal file
@@ -0,0 +1,20 @@
|
||||
--echo Killing server ...
|
||||
|
||||
# Write file to make mysql-test-run.pl expect the crash, but don't start it
|
||||
--let $_server_id= `SELECT @@server_id`
|
||||
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
|
||||
--exec echo "wait" > $_expect_file_name
|
||||
|
||||
# Kill the connected server
|
||||
--disable_reconnect
|
||||
--let KILL_NODE_PIDFILE = `SELECT @@pid_file`
|
||||
|
||||
--perl
|
||||
my $pid_filename = $ENV{'KILL_NODE_PIDFILE'};
|
||||
my $mysqld_pid = `cat $pid_filename`;
|
||||
chomp($mysqld_pid);
|
||||
system("kill -9 $mysqld_pid");
|
||||
exit(0);
|
||||
EOF
|
||||
|
||||
--source include/wait_until_disconnected.inc
|
20
mysql-test/include/wsrep_wait_disconnect.inc
Normal file
20
mysql-test/include/wsrep_wait_disconnect.inc
Normal file
@@ -0,0 +1,20 @@
|
||||
let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready' AND VARIABLE_VALUE = 'OFF';
|
||||
# since this is called until AFTER provider disconnects,we need to allow
|
||||
# queries in non-prim
|
||||
#
|
||||
# We are also forced to use a hard-coded value for wsrep_sync_wait here because
|
||||
# we can not issue a SELECT query to obtain the original value and then restore
|
||||
# it
|
||||
disable_query_log;
|
||||
SET SESSION wsrep_sync_wait = 7;
|
||||
--let $restore_wsrep_on = `SHOW VARIABLES WHERE Variable_name = 'wsrep_on' AND Value = 'ON'`
|
||||
SET SESSION wsrep_on = OFF;
|
||||
|
||||
--source include/wait_condition.inc
|
||||
|
||||
if ($restore_wsrep_on != "")
|
||||
{
|
||||
--eval SET SESSION wsrep_on = ON
|
||||
}
|
||||
SET SESSION wsrep_sync_wait = 15;
|
||||
enable_query_log;
|
Reference in New Issue
Block a user