From c3f327d53b5121e6c12712f33e5014129d4f8b3d Mon Sep 17 00:00:00 2001 From: Sveta Smirnova Date: Thu, 5 Sep 2024 16:45:45 +0300 Subject: [PATCH] PT-2340 - Support MySQL 8.4 - Updated tests for pt-variable-advisor and lib/VariableAdvisorRules --- t/lib/VariableAdvisorRules.t | 6 +++--- t/pt-variable-advisor/samples/vars001-ignore-rules.txt | 2 ++ .../samples/vars001-verbose-verbose.txt | 4 +++- t/pt-variable-advisor/samples/vars001-verbose.txt | 4 +++- t/pt-variable-advisor/samples/vars001.txt | 2 ++ t/pt-variable-advisor/samples/vars002.txt | 2 ++ t/pt-variable-advisor/show_variables_static.t | 10 +++++----- 7 files changed, 20 insertions(+), 10 deletions(-) diff --git a/t/lib/VariableAdvisorRules.t b/t/lib/VariableAdvisorRules.t index fdb18564..90e57d1e 100644 --- a/t/lib/VariableAdvisorRules.t +++ b/t/lib/VariableAdvisorRules.t @@ -160,7 +160,7 @@ my @cases = ( { name => "innodb_max_dirty_pages_pct", vars => [qw(innodb_max_dirty_pages_pct 89)], mysql_version => VersionParser->new('5.1.59'), - advice => [qw(innodb_max_dirty_pages_pct)], + advice => ['innodb_max_dirty_pages_pct', 'end-of-life mysql version'], }, { name => "key_buffer_size", vars => [qw(key_buffer_size 8388608)], @@ -378,11 +378,11 @@ my @cases = ( }, { name => "old mysql version 5.1.29", mysql_version => VersionParser->new('5.1.29'), - advice => ['old mysql version'], + advice => ['old mysql version', 'end-of-life mysql version'], }, { name => "old mysql version 5.5.0", mysql_version => VersionParser->new('5.5.0'), - advice => [], + advice => ['old mysql version', 'end-of-life mysql version'], }, ); diff --git a/t/pt-variable-advisor/samples/vars001-ignore-rules.txt b/t/pt-variable-advisor/samples/vars001-ignore-rules.txt index ac5c2aac..11fde699 100644 --- a/t/pt-variable-advisor/samples/vars001-ignore-rules.txt +++ b/t/pt-variable-advisor/samples/vars001-ignore-rules.txt @@ -16,3 +16,5 @@ # NOTE innodb_flush_method: Most production database servers that use InnoDB should set innodb_flush_method to O_DIRECT to avoid double-buffering, unless the I/O system is very low performance. +# NOTE end-of-life mysql version: Every release older than 8.0 is now officially end-of-life. + diff --git a/t/pt-variable-advisor/samples/vars001-verbose-verbose.txt b/t/pt-variable-advisor/samples/vars001-verbose-verbose.txt index 075bbe61..ab31bc71 100644 --- a/t/pt-variable-advisor/samples/vars001-verbose-verbose.txt +++ b/t/pt-variable-advisor/samples/vars001-verbose-verbose.txt @@ -8,7 +8,7 @@ # NOTE port: The server is listening on a non-default port. -# WARN slave_net_timeout: This variable is set too high. This is too long to wait before noticing that the connection to the master has failed and retrying. This should probably be set to 60 seconds or less. It is also a good idea to use pt-heartbeat to ensure that the connection does not appear to time out when the master is simply idle. +# WARN slave_net_timeout: This variable is set too high. This is too long to wait before noticing that the connection to the replication source has failed and retrying. This should probably be set to 60 seconds or less. It is also a good idea to use pt-heartbeat to ensure that the connection does not appear to time out when the source is simply idle. # WARN expire_logs_days: Binary logs are enabled, but automatic purging is not enabled. If you do not purge binary logs, your disk will fill up. If you delete binary logs externally to MySQL, you will cause unwanted behaviors. Always ask MySQL to purge obsolete logs, never delete them externally. @@ -20,3 +20,5 @@ # WARN sync_binlog: Binary logging is enabled, but sync_binlog isn't configured so that every transaction is flushed to the binary log for durability. +# NOTE end-of-life mysql version: Every release older than 8.0 is now officially end-of-life. + diff --git a/t/pt-variable-advisor/samples/vars001-verbose.txt b/t/pt-variable-advisor/samples/vars001-verbose.txt index 2447917d..f53769c2 100644 --- a/t/pt-variable-advisor/samples/vars001-verbose.txt +++ b/t/pt-variable-advisor/samples/vars001-verbose.txt @@ -8,7 +8,7 @@ # NOTE port: The server is listening on a non-default port. -# WARN slave_net_timeout: This variable is set too high. This is too long to wait before noticing that the connection to the master has failed and retrying. +# WARN slave_net_timeout: This variable is set too high. This is too long to wait before noticing that the connection to the replication source has failed and retrying. # WARN expire_logs_days: Binary logs are enabled, but automatic purging is not enabled. If you do not purge binary logs, your disk will fill up. @@ -20,3 +20,5 @@ # WARN sync_binlog: Binary logging is enabled, but sync_binlog isn't configured so that every transaction is flushed to the binary log for durability. +# NOTE end-of-life mysql version: Every release older than 8.0 is now officially end-of-life. + diff --git a/t/pt-variable-advisor/samples/vars001.txt b/t/pt-variable-advisor/samples/vars001.txt index 273a8960..3900726f 100644 --- a/t/pt-variable-advisor/samples/vars001.txt +++ b/t/pt-variable-advisor/samples/vars001.txt @@ -20,3 +20,5 @@ # WARN sync_binlog: Binary logging is enabled, but sync_binlog isn't configured so that every transaction is flushed to the binary log for durability. +# NOTE end-of-life mysql version: Every release older than 8.0 is now officially end-of-life. + diff --git a/t/pt-variable-advisor/samples/vars002.txt b/t/pt-variable-advisor/samples/vars002.txt index d500767e..8613db29 100644 --- a/t/pt-variable-advisor/samples/vars002.txt +++ b/t/pt-variable-advisor/samples/vars002.txt @@ -18,3 +18,5 @@ # WARN sync_binlog: Binary logging is enabled, but sync_binlog isn't configured so that every transaction is flushed to the binary log for durability. +# NOTE end-of-life mysql version: Every release older than 8.0 is now officially end-of-life. + diff --git a/t/pt-variable-advisor/show_variables_static.t b/t/pt-variable-advisor/show_variables_static.t index e31669dc..f1026c37 100644 --- a/t/pt-variable-advisor/show_variables_static.t +++ b/t/pt-variable-advisor/show_variables_static.t @@ -27,7 +27,7 @@ ok( "t/pt-variable-advisor/samples/vars001.txt", ), "vars001.txt" -); +) or diag($test_diff); ok( no_diff( @@ -36,7 +36,7 @@ ok( "t/pt-variable-advisor/samples/vars002.txt", ), "vars002.txt" -); +) or diag($test_diff); ok( no_diff( @@ -45,7 +45,7 @@ ok( "t/pt-variable-advisor/samples/vars001-verbose.txt", ), "vars001.txt --verbose" -); +) or diag($test_diff); ok( no_diff( @@ -54,7 +54,7 @@ ok( "t/pt-variable-advisor/samples/vars001-verbose-verbose.txt", ), "vars001.txt --verbose --verbose" -); +) or diag($test_diff); ok( no_diff( @@ -64,7 +64,7 @@ ok( "t/pt-variable-advisor/samples/vars001-ignore-rules.txt", ), "--ignore-rules" -); +) or diag($test_diff); my ($output) = full_output(sub { pt_variable_advisor::main(@args,