From 26ca0281b5588273357d36a763965cc291afac68 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Wed, 29 Aug 2012 14:23:41 -0600 Subject: [PATCH] Use --version-check instead (so it's _not_ on by default; it must be specified). --- bin/pt-archiver | 8 +------- bin/pt-config-diff | 8 +------- bin/pt-deadlock-logger | 8 +------- bin/pt-diskstats | 8 +------- bin/pt-duplicate-key-checker | 8 +------- bin/pt-find | 8 +------- bin/pt-fk-error-logger | 8 +------- bin/pt-heartbeat | 8 +------- bin/pt-index-usage | 8 +------- bin/pt-kill | 8 +------- bin/pt-online-schema-change | 8 +------- bin/pt-query-advisor | 8 +------- bin/pt-query-digest | 8 +------- bin/pt-slave-delay | 8 +------- bin/pt-slave-restart | 8 +------- bin/pt-table-checksum | 8 +------- bin/pt-table-sync | 8 +------- bin/pt-upgrade | 8 +------- bin/pt-variable-advisor | 8 +------- lib/PerconaTest.pm | 4 ---- t/pt-archiver/version_check.t | 18 ++++++++---------- t/pt-query-digest/version_check.t | 16 +++++++--------- 22 files changed, 34 insertions(+), 156 deletions(-) diff --git a/bin/pt-archiver b/bin/pt-archiver index d4469d74..09909851 100755 --- a/bin/pt-archiver +++ b/bin/pt-archiver @@ -6825,9 +6825,7 @@ User for login if not current user. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -6837,10 +6835,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =item --where diff --git a/bin/pt-config-diff b/bin/pt-config-diff index b347fe08..28079809 100755 --- a/bin/pt-config-diff +++ b/bin/pt-config-diff @@ -4361,9 +4361,7 @@ MySQL user if not current user. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -4373,10 +4371,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =back diff --git a/bin/pt-deadlock-logger b/bin/pt-deadlock-logger index 7f1f6a3e..e50ff364 100755 --- a/bin/pt-deadlock-logger +++ b/bin/pt-deadlock-logger @@ -4289,9 +4289,7 @@ User for login if not current user. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -4301,10 +4299,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =back diff --git a/bin/pt-diskstats b/bin/pt-diskstats index 277b4714..3db129b5 100755 --- a/bin/pt-diskstats +++ b/bin/pt-diskstats @@ -5170,9 +5170,7 @@ aggregated into one line, the first timestamp is shown. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -5182,10 +5180,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =back diff --git a/bin/pt-duplicate-key-checker b/bin/pt-duplicate-key-checker index c3ae5666..a7abb9a6 100755 --- a/bin/pt-duplicate-key-checker +++ b/bin/pt-duplicate-key-checker @@ -4955,9 +4955,7 @@ Output all keys and/or foreign keys found, not just redundant ones. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -4967,10 +4965,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =back diff --git a/bin/pt-find b/bin/pt-find index 46ba3bdf..cf120f71 100755 --- a/bin/pt-find +++ b/bin/pt-find @@ -4073,9 +4073,7 @@ User for login if not current user. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -4085,10 +4083,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =back diff --git a/bin/pt-fk-error-logger b/bin/pt-fk-error-logger index 75e2260e..82036946 100755 --- a/bin/pt-fk-error-logger +++ b/bin/pt-fk-error-logger @@ -3536,9 +3536,7 @@ User for login if not current user. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -3548,10 +3546,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =back diff --git a/bin/pt-heartbeat b/bin/pt-heartbeat index 3fa3e902..d4aee825 100755 --- a/bin/pt-heartbeat +++ b/bin/pt-heartbeat @@ -5472,9 +5472,7 @@ User for login if not current user. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -5484,10 +5482,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =back diff --git a/bin/pt-index-usage b/bin/pt-index-usage index d1430879..17540958 100755 --- a/bin/pt-index-usage +++ b/bin/pt-index-usage @@ -7000,9 +7000,7 @@ User for login if not current user. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -7012,10 +7010,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =back diff --git a/bin/pt-kill b/bin/pt-kill index 95cb4c03..d8a52ea8 100755 --- a/bin/pt-kill +++ b/bin/pt-kill @@ -6961,9 +6961,7 @@ User for login if not current user. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -6973,10 +6971,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =item --victims diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 784d38eb..0681615b 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -9605,9 +9605,7 @@ User for login if not current user. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -9617,10 +9615,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =back diff --git a/bin/pt-query-advisor b/bin/pt-query-advisor index 6781acf2..49b4b21d 100755 --- a/bin/pt-query-advisor +++ b/bin/pt-query-advisor @@ -8234,9 +8234,7 @@ L<"--report-format">. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -8246,10 +8244,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =item --where diff --git a/bin/pt-query-digest b/bin/pt-query-digest index c2510a7f..19d24c66 100755 --- a/bin/pt-query-digest +++ b/bin/pt-query-digest @@ -16648,9 +16648,7 @@ distinct checksums are treated as equal. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -16660,10 +16658,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =item --watch-server diff --git a/bin/pt-slave-delay b/bin/pt-slave-delay index 5b51453b..a916ace0 100755 --- a/bin/pt-slave-delay +++ b/bin/pt-slave-delay @@ -4119,9 +4119,7 @@ User for login if not current user. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -4131,10 +4129,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =back diff --git a/bin/pt-slave-restart b/bin/pt-slave-restart index 40e769d3..5c9a61f9 100755 --- a/bin/pt-slave-restart +++ b/bin/pt-slave-restart @@ -5038,9 +5038,7 @@ the current sleep time each time pt-slave-restart sleeps. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -5050,10 +5048,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =back diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 1183b0a3..2bf9303c 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -10828,9 +10828,7 @@ group: Help Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -10840,10 +10838,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =item --where diff --git a/bin/pt-table-sync b/bin/pt-table-sync index 67d158be..3423f13a 100755 --- a/bin/pt-table-sync +++ b/bin/pt-table-sync @@ -12054,9 +12054,7 @@ See L<"OUTPUT"> for more details about the output. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -12066,10 +12064,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =item --wait diff --git a/bin/pt-upgrade b/bin/pt-upgrade index 2ea79ba9..29450d74 100755 --- a/bin/pt-upgrade +++ b/bin/pt-upgrade @@ -12635,9 +12635,7 @@ User for login if not current user. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -12647,10 +12645,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =item --zero-query-times diff --git a/bin/pt-variable-advisor b/bin/pt-variable-advisor index eebadad1..b10d46a4 100755 --- a/bin/pt-variable-advisor +++ b/bin/pt-variable-advisor @@ -5393,9 +5393,7 @@ higher levels, the program prints more of the description. Show version and exit. -=item --[no]version-check - -default: yes +=item --version-check Send program versions to Percona and print suggested upgrades and problems. @@ -5405,10 +5403,6 @@ machine. Percona uses the data to focus development on the most widely used versions of programs, and to suggest to customers possible upgrades and known bad versions of programs. -This feature can be disabled by specifying C<--no-version-check> on the -command line or in one of several L<"--config"> files, or by setting the -environment variable C. - For more information, visit L. =back diff --git a/lib/PerconaTest.pm b/lib/PerconaTest.pm index 5cb1cfc8..8cbbb058 100644 --- a/lib/PerconaTest.pm +++ b/lib/PerconaTest.pm @@ -83,10 +83,6 @@ eval { our $can_load_data = can_load_data(); -# We do not want every test doing the version-check; -# that would be quite slow. -$ENV{PERCONA_VERSION_CHECK} = 0; - our $dsn_opts = [ { key => 'A', diff --git a/t/pt-archiver/version_check.t b/t/pt-archiver/version_check.t index 8b97d1b3..9538ef91 100644 --- a/t/pt-archiver/version_check.t +++ b/t/pt-archiver/version_check.t @@ -18,9 +18,6 @@ use File::Spec; use Time::HiRes qw(time); require "$trunk/bin/pt-archiver"; -# PerconaTest.pm sets this because normal tests shouldn't v-c. -delete $ENV{PERCONA_VERSION_CHECK}; - my $dp = new DSNParser(opts=>$dsn_opts); my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); my $master_dbh = $sb->get_dbh_for('master'); @@ -43,7 +40,7 @@ unlink $check_time_file if -f $check_time_file; $sb->create_dbs($master_dbh, ['test']); $sb->load_file('master', 't/pt-archiver/samples/tables1-4.sql'); -$output = `PTVCDEBUG=1 $cmd --source F=$cnf,D=test,t=table_1 --where 1=1 --purge 2>&1`; +$output = `PTVCDEBUG=1 $cmd --source F=$cnf,D=test,t=table_1 --where 1=1 --purge --version-check 2>&1`; like( $output, @@ -67,7 +64,7 @@ ok( # v-c file should limit checks to 1 per 24 hours # ########################################################################### -$output = `PTVCDEBUG=1 $cmd --source F=$cnf,D=test,t=table_1 --where 1=1 --purge 2>&1`; +$output = `PTVCDEBUG=1 $cmd --source F=$cnf,D=test,t=table_1 --where 1=1 --purge --version-check 2>&1`; like( $output, @@ -83,7 +80,7 @@ unlink $check_time_file if -f $check_time_file; my $t0 = time; -$output = `PTVCDEBUG=1 PERCONA_VERSION_CHECK_URL='http://x.percona.com' $cmd --source F=$cnf,D=test,t=table_1 --where 1=1 --purge 2>&1`; +$output = `PTVCDEBUG=1 PERCONA_VERSION_CHECK_URL='http://x.percona.com' $cmd --source F=$cnf,D=test,t=table_1 --where 1=1 --purge --version-check 2>&1`; my $t = time - $t0; @@ -105,17 +102,18 @@ cmp_ok( ); # ########################################################################### -# Disable the v-c. +# Disable the v-c (for now it's disabled by default, so by "disable" here +# we just mean "don't pass --version-check"). # ########################################################################### unlink $check_time_file if -f $check_time_file; -$output = `PTVCDEBUG=1 $cmd --source F=$cnf,D=test,t=table_1 --where 1=1 --purge --no-version-check 2>&1`; +$output = `PTVCDEBUG=1 $cmd --source F=$cnf,D=test,t=table_1 --where 1=1 --purge 2>&1`; unlike( $output, qr/(?:VersionCheck|Pingback|Percona suggests)/, - "Looks like --no-version-check disabled the version-check" + "Looks like no --version-check disabled the version-check" ) or diag($output); ok( @@ -126,7 +124,7 @@ ok( # PERCONA_VERSION_CHECK=0 is handled in Pingback, so it will print a line # for PTVCDEBUG saying why it didn't run. So we just check that it doesn't # create the file which also signifies that it didn't run. -$output = `PTVCDEBUG=1 PERCONA_VERSION_CHECK=0 $cmd --source F=$cnf,D=test,t=table_1 --where 1=1 --purge 2>&1`; +$output = `PTVCDEBUG=1 PERCONA_VERSION_CHECK=0 $cmd --source F=$cnf,D=test,t=table_1 --where 1=1 --purge --version-check 2>&1`; ok( !-f $check_time_file, diff --git a/t/pt-query-digest/version_check.t b/t/pt-query-digest/version_check.t index 12527e14..8fa72d94 100644 --- a/t/pt-query-digest/version_check.t +++ b/t/pt-query-digest/version_check.t @@ -18,9 +18,6 @@ use File::Spec; use Time::HiRes qw(time); require "$trunk/bin/pt-query-digest"; -# PerconaTest.pm sets this because normal tests shouldn't v-c. -delete $ENV{PERCONA_VERSION_CHECK}; - my $output; my $cmd = "$trunk/bin/pt-query-digest --limit 1 $trunk/t/lib/samples/slowlogs/slow001.txt"; @@ -29,7 +26,7 @@ my $dir = File::Spec->tmpdir(); my $check_time_file = File::Spec->catfile($dir,'percona-toolkit-version-check'); unlink $check_time_file if -f $check_time_file; -$output = `PTVCDEBUG=1 $cmd 2>&1`; +$output = `PTVCDEBUG=1 $cmd --version-check 2>&1`; like( $output, @@ -52,7 +49,7 @@ ok( # v-c file should limit checks to 1 per 24 hours # ########################################################################### -$output = `PTVCDEBUG=1 $cmd 2>&1`; +$output = `PTVCDEBUG=1 $cmd --version-check 2>&1`; like( $output, @@ -68,7 +65,7 @@ unlink $check_time_file if -f $check_time_file; my $t0 = time; -$output = `PTVCDEBUG=1 PERCONA_VERSION_CHECK_URL='http://x.percona.com' $cmd 2>&1`; +$output = `PTVCDEBUG=1 PERCONA_VERSION_CHECK_URL='http://x.percona.com' $cmd --version-check 2>&1`; my $t = time - $t0; @@ -90,12 +87,13 @@ cmp_ok( ); # ########################################################################### -# Disable the v-c. +# Disable the v-c (for now it's disabled by default, so by "disable" here +# we just mean "don't pass --version-check"). # ########################################################################### unlink $check_time_file if -f $check_time_file; -$output = `PTVCDEBUG=1 $cmd --no-version-check 2>&1`; +$output = `PTVCDEBUG=1 $cmd 2>&1`; unlike( $output, @@ -111,7 +109,7 @@ ok( # PERCONA_VERSION_CHECK=0 is handled in Pingback, so it will print a line # for PTVCDEBUG saying why it didn't run. So we just check that it doesn't # create the file which also signifies that it didn't run. -$output = `PTVCDEBUG=1 PERCONA_VERSION_CHECK=0 $cmd 2>&1`; +$output = `PTVCDEBUG=1 PERCONA_VERSION_CHECK=0 $cmd --version-check 2>&1`; ok( !-f $check_time_file,