~percona-toolkit-dev/percona-toolkit/release-2.2.2

« back to all changes in this revision

Viewing changes to bin/pt-table-checksum

  • Committer: Brian Fraser
  • Date: 2013-04-16 20:36:43 UTC
  • mfrom: (571.2.1 percona-toolkit)
  • Revision ID: brian.fraser@percona.com-20130416203643-txq6hs5dpmli3ytw
Merged fix-1099845-ptc-pxc-same_node-fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
2803
2803
# ###########################################################################
2804
2804
{
2805
2805
package Lmo::Utils;
 
2806
 
2806
2807
use strict;
2807
2808
use warnings qw( FATAL all );
2808
2809
require Exporter;
2810
2811
 
2811
2812
BEGIN {
2812
2813
   @ISA = qw(Exporter);
2813
 
   @EXPORT = @EXPORT_OK = qw(_install_coderef _unimport_coderefs _glob_for _stash_for);
 
2814
   @EXPORT = @EXPORT_OK = qw(
 
2815
      _install_coderef
 
2816
      _unimport_coderefs
 
2817
      _glob_for
 
2818
      _stash_for
 
2819
   );
2814
2820
}
2815
2821
 
2816
2822
{
2994
3000
   return Lmo::Meta->new(class => $class);
2995
3001
}
2996
3002
 
2997
 
 
2998
3003
1;
2999
3004
}
3000
3005
# ###########################################################################
3658
3663
sub same_node {
3659
3664
   my ($self, $cxn1, $cxn2) = @_;
3660
3665
 
3661
 
   my $sql = "SHOW VARIABLES LIKE 'wsrep\_sst\_receive\_address'";
3662
 
   PTDEBUG && _d($cxn1->name, $sql);
3663
 
   my (undef, $val1) = $cxn1->dbh->selectrow_array($sql);
3664
 
   PTDEBUG && _d($cxn2->name, $sql);
3665
 
   my (undef, $val2) = $cxn2->dbh->selectrow_array($sql);
3666
 
 
3667
 
   return ($val1 || '') eq ($val2 || '');
 
3666
   foreach my $val ('wsrep\_sst\_receive\_address', 'wsrep\_node\_name', 'wsrep\_node\_address') {
 
3667
      my $sql = "SHOW VARIABLES LIKE '$val'";
 
3668
      PTDEBUG && _d($cxn1->name, $cxn2->name, $sql);
 
3669
      my (undef, $val1) = $cxn1->dbh->selectrow_array($sql);
 
3670
      my (undef, $val2) = $cxn2->dbh->selectrow_array($sql);
 
3671
 
 
3672
      return unless ($val1 || '') eq ($val2 || '');
 
3673
   }
 
3674
 
 
3675
   return 1;
3668
3676
}
3669
3677
 
3670
3678
sub same_cluster {
7403
7411
use English qw(-no_match_vars);
7404
7412
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
7405
7413
 
 
7414
use Time::HiRes qw(sleep);
 
7415
 
7406
7416
sub new {
7407
7417
   my ( $class, %args ) = @_;
7408
7418
   my $self = {