Skip to content

Commit

Permalink
MDEV-22179 rr support for mtr review
Browse files Browse the repository at this point in the history
* --rr-arg instead of --rr_option
* Bootstrap saved to rr.bootstrap
* Replication slaves are saved to rr.N dirs
* Perl coding fixes
  • Loading branch information
midenok authored and SachinSetiya committed Jun 22, 2020
1 parent 804ed12 commit 009ef36
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions mysql-test/mysql-test-run.pl
Expand Up @@ -1320,7 +1320,7 @@ sub command_line_setup {
'debug-server' => \$opt_debug_server,
'gdb=s' => \$opt_gdb,
'rr' => \$opt_rr,
'rr_option=s' => \@rr_record_args,
'rr-arg=s' => \@rr_record_args,
'client-gdb' => \$opt_client_gdb,
'manual-gdb' => \$opt_manual_gdb,
'manual-lldb' => \$opt_manual_lldb,
Expand Down Expand Up @@ -1785,11 +1785,16 @@ sub command_line_setup {
mtr_error("Coverage test needs the source - please use source dist");
}

if ( @rr_record_args )
{
$opt_rr= 1;
}

# --------------------------------------------------------------------------
# Check debug related options
# --------------------------------------------------------------------------
if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd || $opt_rr ||
@rr_record_args || $opt_manual_gdb || $opt_manual_lldb || $opt_manual_ddd ||
$opt_manual_gdb || $opt_manual_lldb || $opt_manual_ddd ||
$opt_manual_debug || $opt_dbx || $opt_client_dbx || $opt_manual_dbx ||
$opt_debugger || $opt_client_debugger )
{
Expand Down Expand Up @@ -2446,7 +2451,6 @@ sub environment_setup {
$ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir;
$ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'port'};
$ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir;
$ENV{'_RR_TRACE_DIR'}= "$opt_vardir/rr";
$ENV{'MYSQLTEST_VARDIR'}= $opt_vardir;
$ENV{'MYSQL_BINDIR'}= $bindir;
$ENV{'MYSQL_SHAREDIR'}= $path_language;
Expand Down Expand Up @@ -2756,7 +2760,6 @@ ()
# Create var/tmp and tmp - they might be different
mkpath("$opt_vardir/tmp");
mkpath($opt_tmpdir) if ($opt_tmpdir ne "$opt_vardir/tmp");
mkpath("$opt_vardir/rr");

# On some operating systems, there is a limit to the length of a
# UNIX domain socket's path far below PATH_MAX.
Expand Down Expand Up @@ -3407,8 +3410,11 @@ sub mysql_install_db {
$bootstrap_sql_file);
}
if ($opt_boot_rr) {
$args= ["record", "$exe_mysqld_bootstrap", @$args];
$args= ["record", @rr_record_args, $exe_mysqld_bootstrap, @$args];
$exe_mysqld_bootstrap= "rr";
my $rr_dir= "$opt_vardir/rr.bootstrap";
$ENV{'_RR_TRACE_DIR'}= $rr_dir;
mkpath($rr_dir);
}

my $path_sql= my_find_file($install_basedir,
Expand Down Expand Up @@ -5380,17 +5386,13 @@ ($$)
# Indicate the exe should not be started
$exe= undef;
}
elsif ( $opt_rr || @rr_record_args)
elsif ( $opt_rr )
{
if (@rr_record_args)
{
$args= ["record", @rr_record_args, "$exe", @$args];
}
else
{
$args= ["record", "$exe", @$args];
}
$args= ["record", @rr_record_args, "$exe", @$args];
$exe= "rr";
my $rr_dir= "$opt_vardir/rr". $mysqld->after('mysqld');
$ENV{'_RR_TRACE_DIR'}= $rr_dir;
mkpath($rr_dir);
}
else
{
Expand Down Expand Up @@ -6580,7 +6582,7 @@ ($)
rr Run the "mysqld" executables using rr. Default run
option is "rr record mysqld mysqld_options"
boot-rr Start bootstrap server in rr
rr_option=ARG Option to give rr record, can be specified more then once
rr-arg=ARG Option to give rr record, can be specified more then once
Misc options
user=USER User for connecting to mysqld(default: $opt_user)
Expand Down

0 comments on commit 009ef36

Please sign in to comment.