~percona-toolkit-dev/percona-toolkit/fix-pqd-distill-bugs

« back to all changes in this revision

Viewing changes to lib/Percona/XtraDB/Cluster.pm

  • 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:
54
54
sub same_node {
55
55
   my ($self, $cxn1, $cxn2) = @_;
56
56
 
57
 
   my $sql = "SHOW VARIABLES LIKE 'wsrep\_sst\_receive\_address'";
58
 
   PTDEBUG && _d($cxn1->name, $sql);
59
 
   my (undef, $val1) = $cxn1->dbh->selectrow_array($sql);
60
 
   PTDEBUG && _d($cxn2->name, $sql);
61
 
   my (undef, $val2) = $cxn2->dbh->selectrow_array($sql);
62
 
 
63
 
   return ($val1 || '') eq ($val2 || '');
 
57
   # We check several variables because, if these aren't the same,
 
58
   # we have our answer, but if they are, it doesn't necessarily
 
59
   # mean that we have the same node; See:
 
60
   # https://bugs.launchpad.net/percona-toolkit/+bug/1099845
 
61
   foreach my $val ('wsrep\_sst\_receive\_address', 'wsrep\_node\_name', 'wsrep\_node\_address') {
 
62
      my $sql = "SHOW VARIABLES LIKE '$val'";
 
63
      PTDEBUG && _d($cxn1->name, $cxn2->name, $sql);
 
64
      my (undef, $val1) = $cxn1->dbh->selectrow_array($sql);
 
65
      my (undef, $val2) = $cxn2->dbh->selectrow_array($sql);
 
66
 
 
67
      return unless ($val1 || '') eq ($val2 || '');
 
68
   }
 
69
 
 
70
   return 1;
64
71
}
65
72
 
66
73
sub same_cluster {