Merge 2.1.5-release.

This commit is contained in:
Daniel Nichter
2012-10-12 11:09:46 -06:00
43 changed files with 292 additions and 51 deletions

View File

@@ -1,5 +1,12 @@
Changelog for Percona Toolkit
v2.1.5 released 2012-10-08
* Fixed bug 1062563: pt-table-checksum 2.1.4 doesn't detect diffs on Percona XtraDB Cluster nodes
* Fixed bug 1063912: pt-table-checksum 2.1.4 miscategorizes Percona XtraDB Cluster-based slaves as cluster nodes
* Fixed bug 1064016: pt-table-sync 2.1.4 --version-check may not work with HTTPS/SSL
* Fixed bug 1060423: Missing version-check page
v2.1.4 released 2012-09-20
* pt-table-checksum: Percona XtraDB Cluster support

View File

@@ -2,7 +2,7 @@ use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'percona-toolkit',
VERSION => '2.1.4',
VERSION => '2.1.5',
EXE_FILES => [ <bin/*> ],
MAN1PODS => {
'docs/percona-toolkit.pod' => 'blib/man1/percona-toolkit.1p',

View File

@@ -218,6 +218,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-align 2.1.4
pt-align 2.1.5
=cut

View File

@@ -7489,6 +7489,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-archiver 2.1.4
pt-archiver 2.1.5
=cut

View File

@@ -4803,6 +4803,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-config-diff 2.1.4
pt-config-diff 2.1.5
=cut

View File

@@ -4721,6 +4721,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-deadlock-logger 2.1.4
pt-deadlock-logger 2.1.5
=cut

View File

@@ -5537,6 +5537,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-diskstats 2.1.4
pt-diskstats 2.1.5
=cut

View File

@@ -5385,6 +5385,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-duplicate-key-checker 2.1.4
pt-duplicate-key-checker 2.1.5
=cut

View File

@@ -1560,6 +1560,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-fifo-split 2.1.4
pt-fifo-split 2.1.5
=cut

View File

@@ -4876,6 +4876,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-find 2.1.4
pt-find 2.1.5
=cut

View File

@@ -2151,6 +2151,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-fingerprint 2.1.4
pt-fingerprint 2.1.5
=cut

View File

@@ -3968,6 +3968,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-fk-error-logger 2.1.4
pt-fk-error-logger 2.1.5
=cut

View File

@@ -5902,6 +5902,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-heartbeat 2.1.4
pt-heartbeat 2.1.5
=cut

View File

@@ -7428,6 +7428,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-index-usage 2.1.4
pt-index-usage 2.1.5
=cut

View File

@@ -1103,7 +1103,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-ioprofile 2.1.4
pt-ioprofile 2.1.5
=cut

View File

@@ -7775,6 +7775,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-kill 2.1.4
pt-kill 2.1.5
=cut

View File

@@ -3642,6 +3642,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-log-player 2.1.4
pt-log-player 2.1.5
=cut

View File

@@ -282,7 +282,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-mext 2.1.4
pt-mext 2.1.5
=cut

View File

@@ -2905,7 +2905,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-mysql-summary 2.1.4
pt-mysql-summary 2.1.5
=cut

View File

@@ -10084,6 +10084,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-online-schema-change 2.1.4
pt-online-schema-change 2.1.5
=cut

View File

@@ -396,7 +396,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-pmp 2.1.4
pt-pmp 2.1.5
=cut

View File

@@ -8675,6 +8675,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-query-advisor 2.1.4
pt-query-advisor 2.1.5
=cut

View File

@@ -17305,6 +17305,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-query-digest 2.1.4
pt-query-digest 2.1.5
=cut

View File

@@ -2252,6 +2252,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-show-grants 2.1.4
pt-show-grants 2.1.5
=cut

View File

@@ -781,7 +781,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-sift 2.1.4
pt-sift 2.1.5
=cut

View File

@@ -4548,6 +4548,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-slave-delay 2.1.4
pt-slave-delay 2.1.5
=cut

View File

@@ -4008,6 +4008,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-slave-find 2.1.4
pt-slave-find 2.1.5
=cut

View File

@@ -5468,6 +5468,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-slave-restart 2.1.4
pt-slave-restart 2.1.5
=cut

View File

@@ -1884,7 +1884,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-stalk 2.1.4
pt-stalk 2.1.5
=cut

View File

@@ -2673,7 +2673,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-summary 2.1.4
pt-summary 2.1.5
=cut

View File

@@ -3320,7 +3320,9 @@ sub is_cluster_node {
PTDEBUG && _d($sql);
my $row = $self->{dbh}->selectrow_arrayref($sql);
PTDEBUG && _d(defined $row ? @$row : 'undef');
$self->{is_cluster_node} = $row && $row->[0] ? 1 : 0;
$self->{is_cluster_node} = $row && $row->[1]
? ($row->[1] eq 'ON' || $row->[1] eq '1')
: 0;
return $self->{is_cluster_node};
}
@@ -11330,6 +11332,12 @@ nodes and regular replicas because nodes are not regular replicas so they
cannot be detected automatically. The lag check (see L<"REPLICA CHECKS">)
is not performed for cluster nodes.
Mixed replication setups are not currently supported. For example, the tool
does not work completely if the master host is replicating to a cluster,
or if the cluster is replicating to another cluster. In short, the only
supported setup is a single cluster with nodes optionally having traditional
replication slaves.
=back
=head1 BUGS
@@ -11413,6 +11421,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-table-checksum 2.1.4
pt-table-checksum 2.1.5
=cut

View File

@@ -8389,12 +8389,13 @@ sub valid_item {
sub get_os_version {
my ($self) = @_;
if ( $OSNAME eq 'MSWin32' ) {
require Win32;
return Win32::GetOSDisplayName();
}
chomp(my $platform = `uname -s`);
PTDEBUG && _d('platform:', $platform);
if ( !$platform ) {
return $OSNAME if $OSNAME ne 'MSWin32';
return Win32::GetOSDisplayName();
}
return $OSNAME unless $platform;
chomp(my $lsb_release
@@ -8428,6 +8429,10 @@ sub get_os_version {
$release .= " ($code_name)" if $code_name;
}
}
elsif ( -f "/etc/os-release" ) { # openSUSE
chomp($release = `grep PRETTY_NAME /etc/os-release`);
$release =~ s/^PRETTY_NAME="(.+)"$/$1/;
}
elsif ( `ls /etc/*release 2>/dev/null` ) {
if ( `grep DISTRIB_DESCRIPTION /etc/*release 2>/dev/null` ) {
$release = `grep DISTRIB_DESCRIPTION /etc/*release | head -n1`;
@@ -8437,7 +8442,7 @@ sub get_os_version {
}
}
}
elsif ( $platform =~ m/^(BSD|Darwin)$/ ) {
elsif ( $platform =~ m/(?:BSD|^Darwin)$/ ) {
my $rel = `uname -r`;
$release = "$platform $rel";
}
@@ -8452,6 +8457,8 @@ sub get_os_version {
}
chomp($release);
$release =~ s/^"|"$//g;
PTDEBUG && _d('OS version =', $release);
return $release;
}
@@ -8782,8 +8789,14 @@ sub connect {
IO::Socket::SSL->start_SSL($self->{fh});
ref($self->{fh}) eq 'IO::Socket::SSL'
or die(qq/SSL connection failed for $host\n/);
$self->{fh}->verify_hostname( $host, $ssl_verify_args )
or die(qq/SSL certificate not valid for $host\n/);
if ( $self->{fh}->can("verify_hostname") ) {
$self->{fh}->verify_hostname( $host, $ssl_verify_args );
}
else {
my $fh = $self->{fh};
_verify_hostname_of_cert($host, _peer_certificate($fh), $ssl_verify_args)
or die(qq/SSL certificate not valid for $host\n/);
}
}
$self->{host} = $host;
@@ -9026,6 +9039,179 @@ sub can_write {
return $self->_do_timeout('write', @_)
}
my $prog = <<'EOP';
BEGIN {
if ( defined &IO::Socket::SSL::CAN_IPV6 ) {
*CAN_IPV6 = \*IO::Socket::SSL::CAN_IPV6;
}
else {
constant->import( CAN_IPV6 => '' );
}
my %const = (
NID_CommonName => 13,
GEN_DNS => 2,
GEN_IPADD => 7,
);
while ( my ($name,$value) = each %const ) {
no strict 'refs';
*{$name} = UNIVERSAL::can( 'Net::SSLeay', $name ) || sub { $value };
}
}
{
my %dispatcher = (
issuer => sub { Net::SSLeay::X509_NAME_oneline( Net::SSLeay::X509_get_issuer_name( shift )) },
subject => sub { Net::SSLeay::X509_NAME_oneline( Net::SSLeay::X509_get_subject_name( shift )) },
);
if ( $Net::SSLeay::VERSION >= 1.30 ) {
$dispatcher{commonName} = sub {
my $cn = Net::SSLeay::X509_NAME_get_text_by_NID(
Net::SSLeay::X509_get_subject_name( shift ), NID_CommonName);
$cn =~s{\0$}{}; # work around Bug in Net::SSLeay <1.33
$cn;
}
} else {
$dispatcher{commonName} = sub {
croak "you need at least Net::SSLeay version 1.30 for getting commonName"
}
}
if ( $Net::SSLeay::VERSION >= 1.33 ) {
$dispatcher{subjectAltNames} = sub { Net::SSLeay::X509_get_subjectAltNames( shift ) };
} else {
$dispatcher{subjectAltNames} = sub {
return;
};
}
$dispatcher{authority} = $dispatcher{issuer};
$dispatcher{owner} = $dispatcher{subject};
$dispatcher{cn} = $dispatcher{commonName};
sub _peer_certificate {
my ($self, $field) = @_;
my $ssl = $self->_get_ssl_object or return;
my $cert = ${*$self}{_SSL_certificate}
||= Net::SSLeay::get_peer_certificate($ssl)
or return $self->error("Could not retrieve peer certificate");
if ($field) {
my $sub = $dispatcher{$field} or croak
"invalid argument for peer_certificate, valid are: ".join( " ",keys %dispatcher ).
"\nMaybe you need to upgrade your Net::SSLeay";
return $sub->($cert);
} else {
return $cert
}
}
my %scheme = (
ldap => {
wildcards_in_cn => 0,
wildcards_in_alt => 'leftmost',
check_cn => 'always',
},
http => {
wildcards_in_cn => 'anywhere',
wildcards_in_alt => 'anywhere',
check_cn => 'when_only',
},
smtp => {
wildcards_in_cn => 0,
wildcards_in_alt => 0,
check_cn => 'always'
},
none => {}, # do not check
);
$scheme{www} = $scheme{http}; # alias
$scheme{xmpp} = $scheme{http}; # rfc 3920
$scheme{pop3} = $scheme{ldap}; # rfc 2595
$scheme{imap} = $scheme{ldap}; # rfc 2595
$scheme{acap} = $scheme{ldap}; # rfc 2595
$scheme{nntp} = $scheme{ldap}; # rfc 4642
$scheme{ftp} = $scheme{http}; # rfc 4217
sub _verify_hostname_of_cert {
my $identity = shift;
my $cert = shift;
my $scheme = shift || 'none';
if ( ! ref($scheme) ) {
$scheme = $scheme{$scheme} or croak "scheme $scheme not defined";
}
return 1 if ! %$scheme; # 'none'
my $commonName = $dispatcher{cn}->($cert);
my @altNames = $dispatcher{subjectAltNames}->($cert);
if ( my $sub = $scheme->{callback} ) {
return $sub->($identity,$commonName,@altNames);
}
my $ipn;
if ( CAN_IPV6 and $identity =~m{:} ) {
$ipn = IO::Socket::SSL::inet_pton(IO::Socket::SSL::AF_INET6,$identity)
or croak "'$identity' is not IPv6, but neither IPv4 nor hostname";
} elsif ( $identity =~m{^\d+\.\d+\.\d+\.\d+$} ) {
$ipn = IO::Socket::SSL::inet_aton( $identity ) or croak "'$identity' is not IPv4, but neither IPv6 nor hostname";
} else {
if ( $identity =~m{[^a-zA-Z0-9_.\-]} ) {
$identity =~m{\0} and croak("name '$identity' has \\0 byte");
$identity = IO::Socket::SSL::idn_to_ascii($identity) or
croak "Warning: Given name '$identity' could not be converted to IDNA!";
}
}
my $check_name = sub {
my ($name,$identity,$wtyp) = @_;
$wtyp ||= '';
my $pattern;
if ( $wtyp eq 'anywhere' and $name =~m{^([a-zA-Z0-9_\-]*)\*(.+)} ) {
$pattern = qr{^\Q$1\E[a-zA-Z0-9_\-]*\Q$2\E$}i;
} elsif ( $wtyp eq 'leftmost' and $name =~m{^\*(\..+)$} ) {
$pattern = qr{^[a-zA-Z0-9_\-]*\Q$1\E$}i;
} else {
$pattern = qr{^\Q$name\E$}i;
}
return $identity =~ $pattern;
};
my $alt_dnsNames = 0;
while (@altNames) {
my ($type, $name) = splice (@altNames, 0, 2);
if ( $ipn and $type == GEN_IPADD ) {
return 1 if $ipn eq $name;
} elsif ( ! $ipn and $type == GEN_DNS ) {
$name =~s/\s+$//; $name =~s/^\s+//;
$alt_dnsNames++;
$check_name->($name,$identity,$scheme->{wildcards_in_alt})
and return 1;
}
}
if ( ! $ipn and (
$scheme->{check_cn} eq 'always' or
$scheme->{check_cn} eq 'when_only' and !$alt_dnsNames)) {
$check_name->($commonName,$identity,$scheme->{wildcards_in_cn})
and return 1;
}
return 0; # no match
}
}
EOP
eval { require IO::Socket::SSL };
if ( $INC{"IO/Socket/SSL.pm"} ) {
eval $prog;
die $@ if $@;
}
1;
}
# ###########################################################################
@@ -9113,8 +9299,10 @@ sub version_check {
print "# Percona suggests these upgrades:\n";
print join("\n", map { "# * $_" } @$advice), "\n\n";
}
elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions');
else {
print "# No suggestions at this time.\n\n";
($ENV{PTVCDEBUG} || PTDEBUG )
&& _d('--version-check worked, but there were no suggestions');
}
};
if ( $EVAL_ERROR ) {
@@ -9287,7 +9475,7 @@ sub update_checks_file {
sub _touch {
my ($file) = @_;
sysopen my $fh, $file, O_WRONLY|O_CREAT|O_NONBLOCK
sysopen my $fh, $file, O_WRONLY|O_CREAT
or die "Cannot create $file : $!";
close $fh or die "Cannot close $file : $!";
utime(undef, undef, $file);
@@ -12390,6 +12578,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-table-sync 2.1.4
pt-table-sync 2.1.5
=cut

View File

@@ -7397,6 +7397,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-table-usage 2.1.4
pt-table-usage 2.1.5
=cut

View File

@@ -2532,6 +2532,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-tcp-model 2.1.4
pt-tcp-model 2.1.5
=cut

View File

@@ -2221,6 +2221,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-trend 2.1.4
pt-trend 2.1.5
=cut

View File

@@ -13067,6 +13067,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-upgrade 2.1.4
pt-upgrade 2.1.5
=cut

View File

@@ -5822,6 +5822,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-variable-advisor 2.1.4
pt-variable-advisor 2.1.5
=cut

View File

@@ -3111,6 +3111,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
pt-visual-explain 2.1.4
pt-visual-explain 2.1.5
=cut

View File

@@ -1,3 +1,12 @@
percona-toolkit (2.1.5) unstable; urgency=low
* Fixed bug 1062563: pt-table-checksum 2.1.4 doesn't detect diffs on Percona XtraDB Cluster nodes
* Fixed bug 1063912: pt-table-checksum 2.1.4 miscategorizes Percona XtraDB Cluster-based slaves as cluster nodes
* Fixed bug 1064016: pt-table-sync 2.1.4 --version-check may not work with HTTPS/SSL
* Fixed bug 1060423: Missing version-check page
-- Percona Toolkit Developers <toolkit-dev@percona.com> Mon, 08 Oct 2012 21:00:06 +0000
percona-toolkit (2.1.4) unstable; urgency=low
* pt-table-checksum: Percona XtraDB Cluster support

View File

@@ -50,7 +50,7 @@ copyright = u'2011, Percona Inc'
# The short X.Y version.
version = '2.1'
# The full version, including alpha/beta/rc tags.
release = '2.1.4'
release = '2.1.5'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@@ -510,6 +510,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA.
=head1 VERSION
Percona Toolkit v2.1.4 released 2012-09-20
Percona Toolkit v2.1.5 released 2012-10-08
=cut

View File

@@ -1,6 +1,33 @@
Release Notes
*************
v2.1.5 released 2012-10-08
==========================
Percona Toolkit 2.1.5 has been released. This release is less than two weeks after the release of 2.1.4 because we wanted to address these bugs quickly:
* Bug 1062563: pt-table-checksum 2.1.4 doesn't detect diffs on Percona XtraDB Cluster nodes
* Bug 1063912: pt-table-checksum 2.1.4 miscategorizes Percona XtraDB Cluster-based slaves as cluster nodes
* Bug 1064016: pt-table-sync 2.1.4 --version-check may not work with HTTPS/SSL
The first two bugs fix how pt-table-checksum works with Percona XtraDB Cluster (PXC). Although the 2.1.4 release did introduce support for PXC, these bugs prevented pt-table-checksum from working correctly with a cluster.
The third bug is also related to a feature new in 2.1.4: --version-check. The feature uses HTTPS/SSL by default, but some modules in pt-table-sync weren't update which could prevent it from working on older systems. Related, the version check web page mentioned in tools' documentation was also created.
If you're using pt-table-checksum with a Percona XtraDB Cluster, you should definitely upgrade. Otherwise, users can wait until 2.1.6 for another full release.
Percona Toolkit packages can be downloaded from http://www.percona.com/downloads/percona-toolkit/ or the Percona Software Repositories (http://www.percona.com/software/repositories/).
Changelog
---------
* Fixed bug 1062563: pt-table-checksum 2.1.4 doesn't detect diffs on Percona XtraDB Cluster nodes
* Fixed bug 1063912: pt-table-checksum 2.1.4 miscategorizes Percona XtraDB Cluster-based slaves as cluster nodes
* Fixed bug 1064016: pt-table-sync 2.1.4 --version-check may not work with HTTPS/SSL
* Fixed bug 1060423: Missing version-check page
v2.1.4 released 2012-09-20
==========================

View File

@@ -203,7 +203,9 @@ sub is_cluster_node {
PTDEBUG && _d($sql);
my $row = $self->{dbh}->selectrow_arrayref($sql);
PTDEBUG && _d(defined $row ? @$row : 'undef');
$self->{is_cluster_node} = $row && $row->[0] ? 1 : 0;
$self->{is_cluster_node} = $row && $row->[1]
? ($row->[1] eq 'ON' || $row->[1] eq '1')
: 0;
return $self->{is_cluster_node};
}