From e9a33a5392e56360db7d599db976df9f741bf9f5 Mon Sep 17 00:00:00 2001 From: Rasmus Johansson Date: Tue, 19 May 2020 09:10:24 +0000 Subject: [PATCH 1/4] MDEV-22631 some test causes MTR interruption without generating summary and XML --- mysql-test/lib/mtr_report.pm | 4 +++- mysql-test/mysql-test-run.pl | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index 0b99eafa4cf..d228e9406e0 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -473,7 +473,7 @@ sub mtr_report_stats ($$$$) { $comment =~ s/[\"]//g; # if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML - if ($test->{'result'} eq "MTR_RES_FAILED" || $test->{'retries'}) { + if ($test->{'result'} eq "MTR_RES_FAILED" || $test->{'retries'} > 0) { my $logcontents = $test->{'logfile-failed'} || $test->{'logfile'}; $xml_report .= qq(>\n\t\t\t\n\n\t\t\t\n\t\t\n); @@ -639,6 +639,8 @@ sub mtr_error (@) { } else { + use Carp qw(cluck); + cluck "Error happened" if $verbose > 0; exit(1); } } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 538b76677f4..cd376690461 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -769,8 +769,14 @@ sub run_test_server ($$$) { if ( $result->is_failed() ) { my $worker_logdir= $result->{savedir}; my $log_file_name=dirname($worker_logdir)."/".$result->{shortname}.".log"; - $result->{'logfile-failed'} = mtr_lastlinesfromfile($log_file_name, 20); - rename $log_file_name,$log_file_name.".failed"; + + if (-e $log_file_name) { + $result->{'logfile-failed'} = mtr_lastlinesfromfile($log_file_name, 20); + } else { + $result->{'logfile-failed'} = ""; + } + + rename $log_file_name, $log_file_name.".failed"; } delete($result->{result}); $result->{retries}= $retries+1; From 395ed66b3b4e3b6b785e554ab9794161cef029cd Mon Sep 17 00:00:00 2001 From: Rasmus Johansson Date: Tue, 19 May 2020 15:15:52 +0000 Subject: [PATCH 2/4] MDEV-22636 XML output for mtr doesn't work with valgrind option --- mysql-test/mysql-test-run.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index cd376690461..e4fa0b5231a 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -567,6 +567,7 @@ sub main { # Create minimalistic "test" for the reporting my $tinfo = My::Test->new ( + suite => { name => 'valgrind', }, name => 'valgrind_report', ); # Set dummy worker id to align report with normal tests From 7a5ba59e5f55410e563f7b81238597cf63707e63 Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Tue, 19 May 2020 21:57:01 +0300 Subject: [PATCH 3/4] MDEV-22472 rpl.rpl_fail_register failed in buildbot with wrong result This is a new test from upstream that did not expect the correct value of the command slot of the Dump thread when the latter gets killed. The test is made to expect "Killed" string as the command in show-processlist as it is supposed to when a thread gets killed. --- mysql-test/suite/rpl/t/rpl_fail_register.test | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mysql-test/suite/rpl/t/rpl_fail_register.test b/mysql-test/suite/rpl/t/rpl_fail_register.test index bfecc9d7f14..3a37cc08f44 100644 --- a/mysql-test/suite/rpl/t/rpl_fail_register.test +++ b/mysql-test/suite/rpl/t/rpl_fail_register.test @@ -17,12 +17,11 @@ set global debug_dbug=@old_dbug; connection master; -### why is that needed? let $id=`SELECT id from information_schema.processlist where command='Binlog Dump'`; if ($id) { replace_result $id DUMP_THREAD; eval kill $id; - let $wait_condition= SELECT count(*)=0 from information_schema.processlist where command='Binlog Dump'; + let $wait_condition= SELECT count(*)=0 from information_schema.processlist where command='Killed'; source include/wait_condition.inc; } From 6b2c8cac1b52bee934ac88cc21c6023f48b69e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 20 May 2020 10:33:53 +0300 Subject: [PATCH 4/4] MDEV-22258 Limit innodb_encryption_threads to 255 For no good reason, innodb_encryption_threads was limited to 4,294,967,295. Expectedly, the server would crash if such an insane value was specified. Let us limit the maximum to 255. The encryption threads are not doing much useful work. They are basically only dirtying pages by performing dummy writes via the redo log. The encryption key rotation or the in-place addition or removal of encryption will take place in the page cleaner. In a quick test on a 20-core CPU (40 threads in total), the sweet spot on an otherwise idle server seemed to be innodb_encryption_threads=16 for the test encryption.encrypt_and_grep. The new limit 255 should be more than enough for even bigger servers. --- mysql-test/suite/sys_vars/r/sysvars_innodb.result | 2 +- storage/innobase/handler/ha_innodb.cc | 2 +- storage/xtradb/handler/ha_innodb.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index 38bafc03d6f..7019dda908b 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -826,7 +826,7 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE INT UNSIGNED VARIABLE_COMMENT Number of threads performing background key rotation and scrubbing NUMERIC_MIN_VALUE 0 -NUMERIC_MAX_VALUE 4294967295 +NUMERIC_MAX_VALUE 255 NUMERIC_BLOCK_SIZE 0 ENUM_VALUE_LIST NULL READ_ONLY NO diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index a06a9ed103f..2dd20927545 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -19919,7 +19919,7 @@ static MYSQL_SYSVAR_UINT(encryption_threads, srv_n_fil_crypt_threads, "scrubbing", NULL, innodb_encryption_threads_update, - srv_n_fil_crypt_threads, 0, UINT_MAX32, 0); + 0, 0, 255, 0); static MYSQL_SYSVAR_UINT(encryption_rotate_key_age, srv_fil_crypt_rotate_key_age, diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 06f0388349e..0a77ce56eaf 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -21198,7 +21198,7 @@ static MYSQL_SYSVAR_UINT(encryption_threads, srv_n_fil_crypt_threads, "scrubbing", NULL, innodb_encryption_threads_update, - srv_n_fil_crypt_threads, 0, UINT_MAX32, 0); + 0, 0, 255, 0); static MYSQL_SYSVAR_UINT(encryption_rotate_key_age, srv_fil_crypt_rotate_key_age,