1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-25802 mtr: race condition if the test quickly restarts twice

expect file is always removed before starting a server.
So if it exists here, it means the server started successfully,
mysqltest continued executing the test, created a new expect file,
and shut down the server. All while we were waiting for the server
to start.

In other words, if the expect file exists, the server did actually start.
Even if it isn't running now.

This fixes occasional failures of innodb.log_corruption (in 10.6)
This commit is contained in:
Sergei Golubchik
2021-07-05 21:46:00 +02:00
parent 6a466db00a
commit 1223cfe1d3
2 changed files with 10 additions and 7 deletions

View File

@ -2845,11 +2845,11 @@ sub mysql_server_start($) {
sub mysql_server_wait {
my ($mysqld, $tinfo) = @_;
my $expect_file= "$opt_vardir/tmp/".$mysqld->name().".expect";
if (!sleep_until_file_created($mysqld->value('pid-file'),
$opt_start_timeout,
$mysqld->{'proc'},
$warn_seconds))
if (!sleep_until_file_created($mysqld->value('pid-file'), $expect_file,
$opt_start_timeout, $mysqld->{'proc'},
$warn_seconds))
{
$tinfo->{comment}= "Failed to start ".$mysqld->name() . "\n";
return 1;
@ -5123,7 +5123,8 @@ sub mysqld_start ($$) {
$mysqld->{'started_opts'}= $extra_opts;
return sleep_until_file_created($mysqld->value('pid-file'),
my $expect_file= "$opt_vardir/tmp/".$mysqld->name().".expect";
return sleep_until_file_created($mysqld->value('pid-file'), $expect_file,
$opt_start_timeout, $mysqld->{'proc'}, $warn_seconds);
}