Remove host reordering in hot_standby_delay check
authorJosh Williams <jwilliams@endpoint.com>
Wed, 8 May 2013 19:26:10 +0000 (15:26 -0400)
committerJosh Williams <jwilliams@endpoint.com>
Wed, 8 May 2013 19:26:10 +0000 (15:26 -0400)
This was resulting in the master queries being sent to the replica and
vice versa, if the replica is listed first.  Will probably still want to
reorder the hosts in output (or just list them all) later.
Thanks to Jacobo Blasco for debug assistance.

check_postgres.pl

index d07274d5061d61370a0911e09921df2b811d10d4..2c5e32c621113bb7da2b66cab225f6c4ed29edb6 100755 (executable)
@@ -4763,14 +4763,6 @@ sub check_hot_standby_delay {
         $slave = 2;
     }
 
-    ## If the slave is "db1" and master "db2", go ahead and switch them around for clearer output
-    if (1 == $slave) {
-        ($slave, $master) = (2, 1);
-        for my $k (qw(host port dbname dbuser dbpass)) {
-            ($opt{$k}, $opt{$k . 2}) = ($opt{$k . 2}, $opt{$k}); ## no critic (ProhibitMismatchedOperators)
-        }
-    }
-
     ## Get xlog positions
     my ($moffset, $s_rec_offset, $s_rep_offset);