Commit e5b6db01 authored by Monty's avatar Monty

Speed up atomic test suite by improving wait_until_connected_again.inc

and remove usage of RESET MASTER in loops.

- Remove sleep of 0.1 second that was done even when not needed.
- Don't call include/wait_wsrep_ready.inc if NO_WSREP is defined.
- Added NO_WSREP=1 to all atomic tests.
- Use 'select 1' instead of 'show status' to check is server is up.
- Changed RESET MASTER to FLUSH BINARY LOGS to speed up atomic tests.
  To be able to do this, added a new parameter variable to
  show_events.inc to allow one to specify the name of the binary log
  in the output.
parent 3b8d4180
......@@ -89,6 +89,13 @@ if (!$binlog_database)
--let $output_file= GENERATE
--source include/write_result_to_file.inc
# If requested, change the name of the binary log file in the output
--let $modify_binlog_name=
if ($binlog_output_name != "")
{
--let $modify_binlog_name=s{$_binlog_file}{$binlog_output_name};
}
# Filter the file through the following script.
--delimiter ||
let $script=
......@@ -108,7 +115,9 @@ let $script=
s{SONAME ".*"}{SONAME "LIB"};
s{DOLLARmysqltest_vardir}{MYSQLTEST_VARDIR}g;
s{$binlog_database}{database};
$modify_binlog_name
||
--let $pre_script= my DOLLARmysqltest_vardir = DOLLARENV{'MYSQLTEST_VARDIR'};
--delimiter ;
......
......@@ -12,7 +12,7 @@ let $mysql_errno= 9999;
while ($mysql_errno)
{
--error 0,ER_ACCESS_DENIED_ERROR,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,ER_LOCK_WAIT_TIMEOUT,2002,2006,2013
show status;
select 1;
dec $counter;
if (!$counter)
......@@ -21,16 +21,22 @@ while ($mysql_errno)
}
if (!$mysql_errno)
{
# WSREP: SHOW STATUS queries are allowed even if wsrep
# is not ready. Make sure wsrep is ready before
# returning from this script
source include/wait_wsrep_ready.inc;
if (!$NO_WSREP)
{
# WSREP: SHOW STATUS queries are allowed even if wsrep
# is not ready. Make sure wsrep is ready before
# returning from this script
source include/wait_wsrep_ready.inc;
}
}
if ($mysql_errno == 1045)
{
let $mysql_errno=0;
}
--sleep 0.1
if ($mysql_errno > 0)
{
--sleep 0.1
}
}
--enable_query_log
--enable_result_log
create database test2;
RESET MASTER;
engine: myisam
......
......@@ -22,10 +22,13 @@
--disable_query_log
call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal");
# Speed up wait_until_connected_again.inc
let NO_WSREP=1;
--enable_query_log
let $MYSQLD_DATADIR= `SELECT @@datadir`;
create database test2;
RESET MASTER;
if ($engine_count == "")
{
......@@ -103,7 +106,8 @@ while ($e < $engine_count)
commit;
flush tables;
RESET MASTER;
FLUSH BINARY LOGS;
--let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--echo crash point: $crash
if ($crash_count > 1)
{
......@@ -164,12 +168,18 @@ while ($e < $engine_count)
select count(*) from test2.t2;
}
}
--let $binlog_file=master-bin.000001
--let $binlog_file=$start_binlog_file
--let $binlog_output_name=master-bin.000001
--source include/show_binlog_events.inc
if ($error)
{
--let $binlog_file=master-bin.000002
--source include/show_binlog_events.inc
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $binlog_output_name=master-bin.000002
if ($binlog_file != $start_binlog_file)
{
--source include/show_binlog_events.inc
}
}
}
--disable_warnings
......
create database test2;
RESET MASTER;
engine: aria
......
......@@ -11,6 +11,10 @@
--disable_query_log
call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal");
# Speed up wait_until_connected_again.inc
let NO_WSREP=1;
RESET MASTER;
--enable_query_log
let $MYSQLD_DATADIR= `SELECT @@datadir`;
......@@ -67,7 +71,8 @@ while ($e < $engine_count)
insert into t1 (a) values (1),(2);
flush tables;
RESET MASTER;
FLUSH BINARY LOGS;
--let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--echo crash point: $crash
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--disable_reconnect
......@@ -91,12 +96,17 @@ while ($e < $engine_count)
--list_files $MYSQLD_DATADIR/test *sql*
show create table t1;
select sum(a) from t1;
--let $binlog_file=master-bin.000001
--let $binlog_file=$start_binlog_file
--let $binlog_output_name=master-bin.000001
--source include/show_binlog_events.inc
if ($error)
{
--let $binlog_file=master-bin.000002
--source include/show_binlog_events.inc
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $binlog_output_name=master-bin.000002
if ($binlog_file != $start_binlog_file)
{
--source include/show_binlog_events.inc
}
}
}
--disable_warnings
......
set global rocksdb_flush_log_at_trx_commit=1;
create database test2;
RESET MASTER;
engine: rocksdb
......
......@@ -13,6 +13,9 @@
--disable_query_log
call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal");
# Speed up wait_until_connected_again.inc
let NO_WSREP=1;
RESET MASTER;
--enable_query_log
let $MYSQLD_DATADIR= `SELECT @@datadir`;
......@@ -77,7 +80,9 @@ while ($e < $engine_count)
end|
delimiter ;|
RESET MASTER;
FLUSH BINARY LOGS;
--let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--echo crash point: $crash
if ($crash_count != 1)
{
......@@ -122,12 +127,16 @@ while ($e < $engine_count)
select sum(a) from t2;
}
--let $binlog_file=master-bin.000001
--source include/show_binlog_events.inc
--let $binlog_file=$start_binlog_file
--let $binlog_output_name=master-bin.000001
if ($error)
{
--let $binlog_file=master-bin.000002
--source include/show_binlog_events.inc
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $binlog_output_name=master-bin.000002
if ($binlog_file != $start_binlog_file)
{
--source include/show_binlog_events.inc
}
}
}
--disable_warnings
......
......@@ -15,6 +15,9 @@
--disable_query_log
call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal");
# Speed up wait_until_connected_again.inc
let NO_WSREP=1;
RESET MASTER;
--enable_query_log
let $MYSQLD_DATADIR= `SELECT @@datadir`;
......@@ -89,7 +92,9 @@ while ($e < $engine_count)
{
--source include/set_binlog_format_statement.sql
}
RESET MASTER;
FLUSH BINARY LOGS;
--let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--echo crash point: $crash
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--disable_reconnect
......@@ -111,12 +116,17 @@ while ($e < $engine_count)
--list_files $MYSQLD_DATADIR/test t*
--list_files $MYSQLD_DATADIR/test *sql*
--let $binlog_file=master-bin.000001
--let $binlog_file=$start_binlog_file
--let $binlog_output_name=master-bin.000001
--source include/show_binlog_events.inc
if ($error)
{
--let $binlog_file=master-bin.000002
--source include/show_binlog_events.inc
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $binlog_output_name=master-bin.000002
if ($binlog_file != $start_binlog_file)
{
--source include/show_binlog_events.inc
}
}
# Drop the tables. The warnings will show what was dropped
--disable_warnings
......
RESET MASTER;
"engine: aria crash point: ddl_log_create_before_create_trigger position: 1"
"engine: aria crash point: ddl_log_create_before_create_trigger position: 2"
t1.TRG
......
......@@ -2,6 +2,10 @@
--source include/have_log_bin.inc
--source include/not_valgrind.inc
# Speed up wait_until_connected_again.inc
let NO_WSREP=1;
RESET MASTER;
#
# Testing of atomic CREATE TRIGGER with crashes in a lot of different places
#
......@@ -53,7 +57,8 @@ while ($e < $engine_count)
{
inc $r;
RESET MASTER;
FLUSH BINARY LOGS;
--let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
echo "engine: $engine crash point: $crash position: $r";
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
......@@ -116,7 +121,8 @@ while ($e < $engine_count)
--error 0,ER_TRG_DOES_NOT_EXIST
SHOW CREATE TRIGGER t2_trg;
--let $binlog_file=master-bin.000001
--let $binlog_file=$start_binlog_file
--let $binlog_output_name=master-bin.000001
--source include/show_binlog_events.inc
--disable_warnings
drop trigger if exists t1_trg;
......
......@@ -8,6 +8,9 @@
--disable_query_log
call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal");
# Speed up wait_until_connected_again.inc
let NO_WSREP=1;
RESET MASTER;
--enable_query_log
let $MYSQLD_DATADIR= `SELECT @@datadir`;
......@@ -46,7 +49,9 @@ while ($e < 1)
create view t2 as select "old";
RESET MASTER;
FLUSH BINARY LOGS;
--let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--echo crash point: $crash
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--disable_reconnect
......@@ -69,12 +74,17 @@ while ($e < 1)
--list_files $MYSQLD_DATADIR/test *sql*
select * from t2;
--let $binlog_file=master-bin.000001
--let $binlog_file=$start_binlog_file
--let $binlog_output_name=master-bin.000001
--source include/show_binlog_events.inc
if ($error)
{
--let $binlog_file=master-bin.000002
--source include/show_binlog_events.inc
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $binlog_output_name=master-bin.00c0002
if ($binlog_file != $start_binlog_file)
{
--source include/show_binlog_events.inc
}
}
# Drop the tables. The warnings will show what was dropped
--disable_warnings
......
call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal");
RESET MASTER;
"engine: aria crash point: ddl_log_drop_before_delete_table position: 1"
t1v.frm
t2.MAD
......
......@@ -8,6 +8,9 @@
#
call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal");
# Speed up wait_until_connected_again.inc
let NO_WSREP=1;
RESET MASTER;
let $MYSQLD_DATADIR= `SELECT @@datadir`;
let $engine_count=2;
......@@ -64,10 +67,11 @@ while ($e < $engine_count)
flush tables;
use test;
RESET MASTER;
FLUSH BINARY LOGS;
--let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
echo "engine: $engine crash point: $crash position: $r";
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--disable_reconnect
--eval set @@debug_dbug="+d,$crash",@debug_crash_counter=$r
let $errno=0;
......@@ -90,12 +94,17 @@ while ($e < $engine_count)
--error 0,ER_SP_DOES_NOT_EXIST
show create procedure test2.foo;
--let $binlog_file=master-bin.000001
--let $binlog_file=$start_binlog_file
--let $binlog_output_name=master-bin.000001
--source include/show_binlog_events.inc
if ($error)
{
--let $binlog_file=master-bin.000002
--source include/show_binlog_events.inc
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $binlog_output_name=master-bin.000002
if ($binlog_file != $start_binlog_file)
{
--source include/show_binlog_events.inc
}
}
# Really drop the tables. The warnings will show what was dropped
--disable_warnings
......
RESET MASTER;
"engine: aria crash point: ddl_log_drop_after_drop_tables position: 1"
master-bin.000002 # Query # # use `test2`; DROP TABLE IF EXISTS `tABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB`,`tACCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC`,`tADDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD`,`tAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE`,`tAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF`,`tAGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG`,`tAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH`,`tAIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII`,`tAJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ`,`tAKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK`,`tALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL` /* generated by ddl recovery */
master-bin.000002 # Query # # use `test2`; DROP VIEW IF EXISTS `tABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBv`,`tACCCCCCCCCCCCCCCCCCCCCCCCCCCCCCv`,`tADDDDDDDDDDDDDDDDDDDDDDDDDDDDDDv`,`tAEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEv`,`tAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFv`,`tAGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGv`,`tAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHv`,`tAIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIv`,`tAJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJv`,`tAKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKv` /* generated by ddl recovery */
......
......@@ -2,6 +2,10 @@
--source include/have_log_bin.inc
--source include/not_valgrind.inc
# Speed up wait_until_connected_again.inc
let NO_WSREP=1;
RESET MASTER;
#
# Testing of atomic DROP DATABASE when the generated query could be too long
#
......@@ -63,7 +67,8 @@ while ($e < $engine_count)
flush tables;
use test;
RESET MASTER;
FLUSH BINARY LOGS;
--let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
echo "engine: $engine crash point: $crash position: $r";
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
......@@ -88,12 +93,16 @@ while ($e < $engine_count)
--list_files $MYSQLD_DATADIR/test2 t*
--error 0,ER_SP_DOES_NOT_EXIST
--let $binlog_file=master-bin.000001
--source include/show_binlog_events.inc
--let $binlog_file=$start_binlog_file
--let $binlog_output_name=master-bin.000001
if ($error)
{
--let $binlog_file=master-bin.000002
--source include/show_binlog_events.inc
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $binlog_output_name=master-bin.000002
if ($binlog_file != $start_binlog_file)
{
--source include/show_binlog_events.inc
}
}
# Really drop the tables. The warnings will show what was dropped
--disable_warnings
......
call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal");
RESET MASTER;
create database test2;
"engine: aria crash point: ddl_log_drop_before_delete_table position: 1"
ts.MAD
......
......@@ -8,6 +8,9 @@
#
call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal");
# Speed up wait_until_connected_again.inc
let NO_WSREP=1;
RESET MASTER;
let $MYSQLD_DATADIR= `SELECT @@datadir`;
create database test2;
......@@ -77,7 +80,8 @@ while ($e < $engine_count)
end|
delimiter ;|
RESET MASTER;
FLUSH BINARY LOGS;
--let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
echo "engine: $engine crash point: $crash position: $r";
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
......@@ -100,12 +104,17 @@ while ($e < $engine_count)
--list_files $MYSQLD_DATADIR/test t*
--list_files $MYSQLD_DATADIR/test2 t*
--let $binlog_file=master-bin.000001
--let $binlog_file=$start_binlog_file
--let $binlog_output_name=master-bin.000001
--source include/show_binlog_events.inc
if ($error)
{
--let $binlog_file=master-bin.000002
--source include/show_binlog_events.inc
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $binlog_output_name=master-bin.000002
if ($binlog_file != $start_binlog_file)
{
--source include/show_binlog_events.inc
}
}
# Really drop the tables. The warnings will show what was dropped
--disable_warnings
......
call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal");
RESET MASTER;
"engine: myisam crash point: ddl_log_drop_before_delete_table position: 1"
t2.MYD
t2.MYI
......
......@@ -9,6 +9,9 @@
#
call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal");
# Speed up wait_until_connected_again.inc
let NO_WSREP=1;
RESET MASTER;
let $MYSQLD_DATADIR= `SELECT @@datadir`;
let $engine_count=5;
......@@ -75,7 +78,8 @@ while ($e < $engine_count)
end|
delimiter ;|
RESET MASTER;
FLUSH BINARY LOGS;
--let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
echo "engine: $engine crash point: $crash position: $r";
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
......@@ -97,12 +101,17 @@ while ($e < $engine_count)
# Check which tables still exists
--list_files $MYSQLD_DATADIR/test t*
--let $binlog_file=master-bin.000001
--let $binlog_file=$start_binlog_file
--let $binlog_output_name=master-bin.000001
--source include/show_binlog_events.inc
if ($error)
{
--let $binlog_file=master-bin.000002
--source include/show_binlog_events.inc
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $binlog_output_name=master-bin.000002
if ($binlog_file != $start_binlog_file)
{
--source include/show_binlog_events.inc
}
}
# Really drop the tables. The warnings will show what was dropped
--disable_warnings
......
RESET MASTER;
"engine: aria crash point: ddl_log_drop_before_drop_trigger position: 1"
t1.TRG
t1_trg.TRN
......
......@@ -6,6 +6,9 @@
# Testing of atomic drop with crashes in a lot of different places
#
# Speed up wait_until_connected_again.inc
let NO_WSREP=1;
RESET MASTER;
let $MYSQLD_DATADIR= `SELECT @@datadir`;
let long_comment=`select repeat('a',16384)`;
......@@ -70,7 +73,8 @@ while ($e < $engine_count)
end|
delimiter ;|
RESET MASTER;
FLUSH BINARY LOGS;
--let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
echo "engine: $engine crash point: $crash position: $r";
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
......@@ -99,12 +103,17 @@ while ($e < $engine_count)
# Check which tables still exists
--list_files $MYSQLD_DATADIR/test *TR*
--let $binlog_file=master-bin.000001
--let $binlog_file=$start_binlog_file
--let $binlog_output_name=master-bin.000001
--source include/show_binlog_events.inc
if ($error)
{
--let $binlog_file=master-bin.000002
--source include/show_binlog_events.inc
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $binlog_output_name=master-bin.000002
if ($binlog_file != $start_binlog_file)
{
--source include/show_binlog_events.inc
}
}
--disable_warnings
drop table if exists t1;
......
RESET MASTER;
"engine: aria crash point: ddl_log_drop_before_delete_view position: 1"
v2.frm
master-bin.000002 # Query # # use `test`; DROP VIEW IF EXISTS `v1` /* generated by ddl recovery */
......
......@@ -6,7 +6,11 @@
# Testing of atomic drop of view with crashes in a lot of different places
#
# Speed up wait_until_connected_again.inc
let NO_WSREP=1;
RESET MASTER;
let $MYSQLD_DATADIR= `SELECT @@datadir`;
let $engine_count=1;
let $engines='aria';
......@@ -58,7 +62,9 @@ while ($e < $engine_count)
inc $r;
create view v1 as select * from t1;
create view v2 as select * from t1;
RESET MASTER;
FLUSH BINARY LOGS;
--let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
echo "engine: $engine crash point: $crash position: $r";
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
......@@ -79,12 +85,18 @@ while ($e < $engine_count)
}
# Check which tables still exists
--list_files $MYSQLD_DATADIR/test v*
--let $binlog_file=master-bin.000001
--let $binlog_file=$start_binlog_file
--let $binlog_output_name=master-bin.000001
--source include/show_binlog_events.inc
if ($error)
{
--let $binlog_file=master-bin.000002
--source include/show_binlog_events.inc
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $binlog_output_name=master-bin.000002
if ($binlog_file != $start_binlog_file)
{
--source include/show_binlog_events.inc
}
}
# Really drop the views
--disable_warnings
......
......@@ -4,6 +4,9 @@
--source include/not_valgrind.inc
--source include/not_embedded.inc
# Speed up wait_until_connected_again.inc
let NO_WSREP=1;
#
# Testing of atomic rename with forced crashes in a lot of different places
#
......
......@@ -4,6 +4,10 @@
--source include/have_log_bin.inc
--source include/not_valgrind.inc
# Speed up wait_until_connected_again.inc
let NO_WSREP=1;
RESET MASTER;
#
# Testing of atomic rename with binlogging
# - First crash is before binlog is written, in which case the rename should
......@@ -11,8 +15,6 @@
# - Second crash is after binlog is written, in which case the rename should hold
#
RESET MASTER;
let $engine_count=2;
let $engines='myisam', 'aria';
......
......@@ -4,6 +4,9 @@
--source include/not_valgrind.inc
--source include/not_embedded.inc
# Speed up wait_until_connected_again.inc
let NO_WSREP=1;
#
# Testing of atomic rename of table with triggers when table rename works but
# rename of trigger fails.
......
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