Commit 6e9b06d9 authored by unknown's avatar unknown

Fix a number of problems in the test suite (no code bugs):

 - mysql-test-run.pl --valgrind complains when all tests succeed.

 - perfschema.all_instances fail on non-linux, where ENABLE_TEMP_POOL
   is not set and therefore BITMAP mutex is not used.

 - MDEV-132: main.mysqldump fails because it depends on exact size of stdio
   buffers.

 - MDEV-99: rpl.rpl_cant_read_event_incident fails due to a race where the
   slave manages to connect while the test case is in the middle of setting up
   the master, causing the slave to replicate extra/wrong events.

 - MDEV-133: rpl.rpl_rotate_purge_deadlock fails because it issues a
   DEBUG_SYNC SIGNAL immediately followed by RESET; this means that sometimes
   the intended receipient has no time to see the signal before it is cleared
   by the RESET, causing wait to timeout.
parent a03d8465
......@@ -584,6 +584,7 @@ sub main {
}
mtr_report_test($tinfo);
push @$completed, $tinfo;
++$num_tests
}
mtr_print_line();
......@@ -599,7 +600,8 @@ sub main {
if ( @$completed != $num_tests)
{
mtr_error("Not all tests completed");
mtr_error("Not all tests completed (only ". scalar(@$completed) .
" of $num_tests)");
}
remove_vardir_subs() if $opt_clean_vardir;
......
......@@ -4770,79 +4770,11 @@ INSERT INTO b12809202_db.t2 VALUES (1), (2), (3);
-- Retrieving table structure for table t1...
-- Sending SELECT query...
-- Retrieving rows...
--
-- Host: localhost Database: b12809202_db
-- ------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `t1`
--
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` (
`c1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t1`
--
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT INTO `t1` VALUES (1),(2),(3);
-- Retrieving table structure for table t2...
-- Sending SELECT query...
-- Retrieving rows...
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t2`
--
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t2` (
`c1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t2`
--
LOCK TABLES `t2` WRITE;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
INSERT INTO `t2` VALUES (1),(2),(3);
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
UNLOCK TABLES;
-- Disconnecting from localhost...
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed
#### Dump ends here ####
DROP TABLE b12809202_db.t1;
DROP TABLE b12809202_db.t2;
......
use performance_schema;
select name from mutex_instances where name not rlike '/(DEBUG_SYNC::mutex)$' group by name;
select name from mutex_instances
where name not rlike '/(DEBUG_SYNC::mutex)$'
and name != 'wait/synch/mutex/mysys/BITMAP::mutex'
group by name;
name
wait/synch/mutex/archive/archive_mutex
wait/synch/mutex/aria/LOCK_trn_list
......@@ -16,7 +19,6 @@ wait/synch/mutex/blackhole/blackhole
wait/synch/mutex/csv/tina
wait/synch/mutex/memory/HP_SHARE::intern_lock
wait/synch/mutex/myisam/MYISAM_SHARE::intern_lock
wait/synch/mutex/mysys/BITMAP::mutex
wait/synch/mutex/mysys/KEY_CACHE::cache_lock
wait/synch/mutex/mysys/LOCK_alarm
wait/synch/mutex/mysys/LOCK_uuid_generator
......
......@@ -17,7 +17,10 @@ use performance_schema;
# "where" filters out instances that can be conditionally compiled out
#
select name from mutex_instances where name not rlike '/(DEBUG_SYNC::mutex)$' group by name;
select name from mutex_instances
where name not rlike '/(DEBUG_SYNC::mutex)$'
and name != 'wait/synch/mutex/mysys/BITMAP::mutex'
group by name;
# CRYPTO_dynlock_value::lock exists only when building with OpenSSL (not YaSSL).
select name from rwlock_instances
where name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock")
......
include/master-slave.inc
[connection master]
include/stop_slave.inc
call mtr.add_suppression("Error in Log_event::read_log_event()");
include/rpl_stop_server.inc [server_number=1]
include/rpl_start_server.inc [server_number=1]
show binlog events;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
stop slave;
reset slave;
start slave;
include/wait_for_slave_param.inc [Last_IO_Errno]
......
......@@ -5,6 +5,7 @@ Log_name File_size
master-bin.000001 #
create table t1 (f text) engine=innodb;
SET DEBUG_SYNC = 'at_purge_logs_before_date WAIT_FOR rotated';
SET DEBUG_SYNC = 'after_purge_logs_before_date SIGNAL continued';
insert into t1 set f=repeat('a', 4096);
*** there must be two logs in the list ***
show binary logs;
......@@ -19,11 +20,14 @@ master-bin.000001 #
master-bin.000002 #
master-bin.000003 #
SET DEBUG_SYNC = 'now SIGNAL rotated';
SET DEBUG_SYNC = 'now WAIT_FOR continued';
SET DEBUG_SYNC = 'RESET';
SET DEBUG_SYNC = 'RESET';
SET DEBUG_SYNC = 'at_purge_logs_before_date WAIT_FOR rotated';
SET DEBUG_SYNC = 'after_purge_logs_before_date SIGNAL continued';
insert into t1 set f=repeat('b', 4096);
SET DEBUG_SYNC = 'now SIGNAL rotated';
SET DEBUG_SYNC = 'now WAIT_FOR continued';
SET DEBUG_SYNC = 'RESET';
SET DEBUG_SYNC = 'RESET';
drop table t1;
......
......@@ -20,9 +20,15 @@
#
--source include/not_windows.inc
call mtr.add_suppression("Error in Log_event::read_log_event()");
--connection slave
# Make sure the slave is stopped while we are messing with master.
# Otherwise we get occasional failures as the slave manages to re-connect
# to the newly started master and we get extra events applied, causing
# conflicts.
--source include/stop_slave.inc
--connection master
call mtr.add_suppression("Error in Log_event::read_log_event()");
--let $datadir= `SELECT @@datadir`
--let $rpl_server_number= 1
......@@ -42,7 +48,6 @@ show binlog events;
--connection slave
call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
stop slave;
reset slave;
start slave;
......
......@@ -20,6 +20,7 @@ connection master;
source include/show_binary_logs.inc;
create table t1 (f text) engine=innodb;
SET DEBUG_SYNC = 'at_purge_logs_before_date WAIT_FOR rotated';
SET DEBUG_SYNC = 'after_purge_logs_before_date SIGNAL continued';
send insert into t1 set f=repeat('a', 4096);
connection master1;
......@@ -38,6 +39,7 @@ insert into t1 set f=repeat('b', 4096);
source include/show_binary_logs.inc;
SET DEBUG_SYNC = 'now SIGNAL rotated';
SET DEBUG_SYNC = 'now WAIT_FOR continued';
SET DEBUG_SYNC = 'RESET';
# the first connection finally completes its INSERT
......@@ -54,6 +56,7 @@ sync_slave_with_master;
connection master;
SET DEBUG_SYNC = 'at_purge_logs_before_date WAIT_FOR rotated';
SET DEBUG_SYNC = 'after_purge_logs_before_date SIGNAL continued';
send insert into t1 set f=repeat('b', 4096);
connection master1;
......@@ -80,6 +83,7 @@ let $wait_condition=
--source include/wait_condition.inc
SET DEBUG_SYNC = 'now SIGNAL rotated';
SET DEBUG_SYNC = 'now WAIT_FOR continued';
SET DEBUG_SYNC = 'RESET';
connection master;
......
......@@ -2249,8 +2249,12 @@ INSERT INTO b12809202_db.t2 VALUES (1), (2), (3);
--echo # commit starting 5.5.
--echo
--echo #### Dump starts here ####
# We only need to check the --verbose output to verify that "start transaction"
# happens after "logs flushed". We redirect normal output, as otherwise the
# mixing of normal (stdout) and --verbose (stderr) output will happen in random
# order depending on stdio internal buffer size.
--replace_regex /-- Server version.*// /-- MySQL dump .*// /-- Dump completed on .*/-- Dump completed/
--exec $MYSQL_DUMP --verbose --single-transaction --flush-log b12809202_db 2>&1
--exec $MYSQL_DUMP --verbose --single-transaction --flush-log b12809202_db 2>&1 > $MYSQLTEST_VARDIR/tmp/bug61854.sql
--echo
--echo #### Dump ends here ####
......
......@@ -5372,6 +5372,7 @@ void MYSQL_BIN_LOG::purge()
{
purge_logs_before_date(purge_time);
}
DEBUG_SYNC(current_thd, "after_purge_logs_before_date");
}
#endif
}
......
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