mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-19 10:34:01 +00:00
Fix for 1099845: pt-table-checksum pxc same_node function incorrectly uses wsrep_sst_receive_address
This commit is contained in:
@@ -54,13 +54,29 @@ sub is_cluster_node {
|
||||
sub same_node {
|
||||
my ($self, $cxn1, $cxn2) = @_;
|
||||
|
||||
my $sql = "SHOW VARIABLES LIKE 'wsrep\_sst\_receive\_address'";
|
||||
PTDEBUG && _d($cxn1->name, $sql);
|
||||
my (undef, $val1) = $cxn1->dbh->selectrow_array($sql);
|
||||
PTDEBUG && _d($cxn2->name, $sql);
|
||||
my (undef, $val2) = $cxn2->dbh->selectrow_array($sql);
|
||||
my $sub = sub {
|
||||
my $sql = shift;
|
||||
my @temp;
|
||||
PTDEBUG && _d($cxn1->name, $cxn2->name, $sql);
|
||||
for ($cxn1->dbh, $cxn2->dbh) {
|
||||
my (undef, $v) = $_->selectrow_array($sql);
|
||||
push @temp, $v;
|
||||
}
|
||||
return @temp
|
||||
};
|
||||
|
||||
# We check several variables because, if these aren't the same,
|
||||
# we have our answer, but if they are, it doesn't necessarily
|
||||
# mean that we have the same node; See:
|
||||
# https://bugs.launchpad.net/percona-toolkit/+bug/1099845
|
||||
for my $val ('wsrep\_sst\_receive\_address', 'wsrep\_node\_name', 'wsrep\_node\_address') {
|
||||
my $sql = "SHOW VARIABLES LIKE '$val'";
|
||||
my ($val1, $val2) = $sub->($sql);
|
||||
return unless ($val1 || '') eq ($val2 || '');
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
return ($val1 || '') eq ($val2 || '');
|
||||
}
|
||||
|
||||
sub same_cluster {
|
||||
|
Reference in New Issue
Block a user