mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-12 14:18:32 +00:00
Fixed version
This commit is contained in:
@@ -2803,6 +2803,7 @@ if ( PTDEBUG ) {
|
|||||||
# ###########################################################################
|
# ###########################################################################
|
||||||
{
|
{
|
||||||
package Lmo::Utils;
|
package Lmo::Utils;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings qw( FATAL all );
|
use warnings qw( FATAL all );
|
||||||
require Exporter;
|
require Exporter;
|
||||||
@@ -2810,7 +2811,12 @@ our (@ISA, @EXPORT, @EXPORT_OK);
|
|||||||
|
|
||||||
BEGIN {
|
BEGIN {
|
||||||
@ISA = qw(Exporter);
|
@ISA = qw(Exporter);
|
||||||
@EXPORT = @EXPORT_OK = qw(_install_coderef _unimport_coderefs _glob_for _stash_for);
|
@EXPORT = @EXPORT_OK = qw(
|
||||||
|
_install_coderef
|
||||||
|
_unimport_coderefs
|
||||||
|
_glob_for
|
||||||
|
_stash_for
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -2994,7 +3000,6 @@ sub meta {
|
|||||||
return Lmo::Meta->new(class => $class);
|
return Lmo::Meta->new(class => $class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
}
|
}
|
||||||
# ###########################################################################
|
# ###########################################################################
|
||||||
@@ -3658,13 +3663,16 @@ sub is_cluster_node {
|
|||||||
sub same_node {
|
sub same_node {
|
||||||
my ($self, $cxn1, $cxn2) = @_;
|
my ($self, $cxn1, $cxn2) = @_;
|
||||||
|
|
||||||
my $sql = "SHOW VARIABLES LIKE 'wsrep\_sst\_receive\_address'";
|
foreach my $val ('wsrep\_sst\_receive\_address', 'wsrep\_node\_name', 'wsrep\_node\_address') {
|
||||||
PTDEBUG && _d($cxn1->name, $sql);
|
my $sql = "SHOW VARIABLES LIKE '$val'";
|
||||||
my (undef, $val1) = $cxn1->dbh->selectrow_array($sql);
|
PTDEBUG && _d($cxn1->name, $cxn2->name, $sql);
|
||||||
PTDEBUG && _d($cxn2->name, $sql);
|
my (undef, $val1) = $cxn1->dbh->selectrow_array($sql);
|
||||||
my (undef, $val2) = $cxn2->dbh->selectrow_array($sql);
|
my (undef, $val2) = $cxn2->dbh->selectrow_array($sql);
|
||||||
|
|
||||||
return ($val1 || '') eq ($val2 || '');
|
return unless ($val1 || '') eq ($val2 || '');
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub same_cluster {
|
sub same_cluster {
|
||||||
@@ -7403,6 +7411,8 @@ use warnings FATAL => 'all';
|
|||||||
use English qw(-no_match_vars);
|
use English qw(-no_match_vars);
|
||||||
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
||||||
|
|
||||||
|
use Time::HiRes qw(sleep);
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ( $class, %args ) = @_;
|
my ( $class, %args ) = @_;
|
||||||
my $self = {
|
my $self = {
|
||||||
|
@@ -54,13 +54,20 @@ sub is_cluster_node {
|
|||||||
sub same_node {
|
sub same_node {
|
||||||
my ($self, $cxn1, $cxn2) = @_;
|
my ($self, $cxn1, $cxn2) = @_;
|
||||||
|
|
||||||
my $sql = "SHOW VARIABLES LIKE 'wsrep\_sst\_receive\_address'";
|
# We check several variables because, if these aren't the same,
|
||||||
PTDEBUG && _d($cxn1->name, $sql);
|
# we have our answer, but if they are, it doesn't necessarily
|
||||||
my (undef, $val1) = $cxn1->dbh->selectrow_array($sql);
|
# mean that we have the same node; See:
|
||||||
PTDEBUG && _d($cxn2->name, $sql);
|
# https://bugs.launchpad.net/percona-toolkit/+bug/1099845
|
||||||
my (undef, $val2) = $cxn2->dbh->selectrow_array($sql);
|
foreach my $val ('wsrep\_sst\_receive\_address', 'wsrep\_node\_name', 'wsrep\_node\_address') {
|
||||||
|
my $sql = "SHOW VARIABLES LIKE '$val'";
|
||||||
|
PTDEBUG && _d($cxn1->name, $cxn2->name, $sql);
|
||||||
|
my (undef, $val1) = $cxn1->dbh->selectrow_array($sql);
|
||||||
|
my (undef, $val2) = $cxn2->dbh->selectrow_array($sql);
|
||||||
|
|
||||||
return ($val1 || '') eq ($val2 || '');
|
return unless ($val1 || '') eq ($val2 || '');
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub same_cluster {
|
sub same_cluster {
|
||||||
|
Reference in New Issue
Block a user