LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: ldirectord v 1.88 2004/05/27 05:29:05 fallback problems again

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: ldirectord v 1.88 2004/05/27 05:29:05 fallback problems again
Cc: Tuomo Soini <tis@xxxxxxxxx>
From: Horms <horms@xxxxxxxxxxxx>
Date: Wed, 2 Jun 2004 19:55:33 +0900
On Wed, Jun 02, 2004 at 04:26:06PM +0900, Horms wrote:
> On Wed, Jun 02, 2004 at 10:00:58AM +1000, Jonathan Trott wrote:
> > I'm still having problems getting the fallback feature working 
> > properly. Now I'm getting the fallback server added on half of my 
> > server pools but not the other half. At least I'm not getting the 
> > fallback server added to pools with live servers in them, but I'm not 
> > getting the extected behaviour either.
> > Any ideas?
> 
> Hi Jonathan,
> 
> thanks for the detailed bug report. It seems that
> there is indeed a problem that is only exhibited with quiescent=no.
> I also suspect there might be some other related bugs to do with
> reloading the config and toggling quiescent. I hope to have a fix
> available shortly.

Hi,

I have a patch to fix your immediate problem.
However in the course of testing this I found
some other problems relating to starting
ldirectord when all the real servers are unavailable,
and modifying ldrirectord.cf. I hope to
have a more extensive patch to resolve these problems
available shortly, however it won't be today.

I have not put this patch into CVS yet.

-- 
Horms

Index: ldirectord
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/ldirectord/ldirectord,v
retrieving revision 1.89
diff -u -r1.89 ldirectord
--- ldirectord  31 May 2004 02:27:24 -0000      1.89
+++ ldirectord  2 Jun 2004 08:22:33 -0000
@@ -2170,7 +2177,7 @@
 
 sub _status_up
 {
-       my ($v, $r) = (@_);
+       my ($v, $r, $is_fallback) = (@_);
 
        my $virtual_id = get_virtual_id_str($v);
 
@@ -2183,7 +2190,9 @@
                $r->{virtual_status} = {};
        }
        $r->{virtual_status}->{"$virtual_id"} = 1;
-       $v->{status}++;
+       if (! defined $is_fallback) {
+               $v->{status}++;
+       }
 
        return 1;
 }
@@ -2193,7 +2202,7 @@
 
 sub _status_down
 {
-       my ($v, $r) = (@_);
+       my ($v, $r, $is_fallback) = (@_);
 
        my $virtual_id = get_virtual_id_str($v);
 
@@ -2203,7 +2212,9 @@
        }
        
        delete $r->{virtual_status}->{"$virtual_id"};
-       $v->{status}--;
+       if (! defined $is_fallback) {
+               $v->{status}--;
+       }
        if (! %{$r->{virtual_status}}) {
                $r->{virtual_status} = undef;
        }
@@ -2277,11 +2289,14 @@
        my ($v) = (@_);
 
        my $fallback=&fallback_find($v);
-       if (defined $fallback and $$v{status}==0) {
-                _restore_service($v, $fallback->{server}, 
-                        get_forward_flag($fallback->{forward}), 
-                        "1", "fallback");
+
+       if ($v->{status} ne 0 or ! _status_down($v, $fallback, "fallback")) {
+               return;
        }
+
+       &_restore_service($v, $fallback->{server}, 
+                       get_forward_flag($fallback->{forward}), 
+                               "1", "fallback");
 }
 
 
@@ -2296,11 +2311,14 @@
        my ($v) = (@_);
 
        my $fallback=&fallback_find($v);
-       if (defined $fallback and $$v{status}==1) {
-                _remove_service($v, $fallback->{server},
-                         get_forward_flag($fallback->{forward}),
-                         "fallback");
+
+       if (! _status_up($v, $fallback, "fallback")) {
+               return;
        }
+
+       &_remove_service($v, $fallback->{server},
+                       get_forward_flag($fallback->{forward}),
+                               "fallback");
 }
 
 
<Prev in Thread] Current Thread [Next in Thread>