Move set should check for active nodes, not inactive as state can also be failed
authorglyn <glyn@8kb.co.uk>
Wed, 7 May 2014 11:52:22 +0000 (12:52 +0100)
committerglyn <glyn@8kb.co.uk>
Wed, 7 May 2014 11:52:22 +0000 (12:52 +0100)
slony_failover.pl

index 32c938d..672a1a4 100644 (file)
@@ -1168,7 +1168,7 @@ sub writeMoveSet {
                 if (($subs) && ($g_resubscribe_method eq 'subscribe')) { 
     
                     foreach my $other_subs (@g_cluster) {
-                        if (($other_subs->[6] ne "INACTIVE") && ($other_subs->[0] != $from) && ($other_subs->[0] != $to)) {
+                        if (($other_subs->[6] eq "ACTIVE") && ($other_subs->[0] != $from) && ($other_subs->[0] != $to)) {
 
                             if (exists $g_backups{$other_subs->[0]}) {
                                 $line_prefix = "# (Node $other_subs->[0] unavailable) ";
@@ -1236,7 +1236,7 @@ sub writeMoveSet {
             if (($subs) && ($g_resubscribe_method eq 'resubscribe')) { 
 
                 foreach my $other_subs (@g_cluster) {
-                    if (($other_subs->[6] ne "INACTIVE") && ($other_subs->[0] != $from) && ($other_subs->[0] != $to)) {
+                    if (($other_subs->[6] eq "ACTIVE") && ($other_subs->[0] != $from) && ($other_subs->[0] != $to)) {
                         if (exists $g_backups{$other_subs->[0]}) {
                             $line_prefix = "# (Node $other_subs->[0] unavailable) ";
                         }