diff options
author | Andrew Yochum | 2014-07-03 14:15:27 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2014-07-03 14:15:27 +0000 |
commit | ab419e1d751675ca194ef5ff57f18486d3cdaf98 (patch) | |
tree | b88d5d706cb0bc82bac27a560ff68eb8f1a6b155 /check_postgres.pl | |
parent | 5bccf3050a00aee74a9292d9b4a2131a6c777bcf (diff) |
Improved multi-slave support in replicate_row.
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-x | check_postgres.pl | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/check_postgres.pl b/check_postgres.pl index 3ccaf6247..508fc037a 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -6174,16 +6174,13 @@ sub check_replicate_row { } my $value1 = $info1->{db}[0]{slurp}[0]{c} || ''; - my $info2 = run_command($select, { dbnumber => 2 }); - my $slave = 0; - for my $d (@{$info2->{db}}) { - $slave++; + my $numslaves = @{$info1->{db}} - 1; + for my $d ( @{$info1->{db}}[1 .. $numslaves] ) { my $value2 = $d->{slurp}[0]{c} || ''; if ($value1 ne $value2) { ndie msg('rep-notsame'); } } - my $numslaves = $slave; if ($numslaves < 1) { ndie msg('rep-noslaves'); } @@ -6224,12 +6221,12 @@ sub check_replicate_row { my %slave; my $time = 0; LOOP: { - $info2 = run_command($select, { dbnumber => 2 } ); + my $info2 = run_command($select); ## Reset for final output $db = $sourcedb; - $slave = 0; - for my $d (@{$info2->{db}}) { + my $slave = 0; + for my $d (@{$info2->{db}}[1 .. $numslaves]) { $slave++; next if exists $slave{$slave}; my $value2 = $d->{slurp}[0]{c}; |