LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: Broken ldirectord reload

To: Roberto Nibali <ratz@xxxxxxxxxxxx>, Tomas Hoger <tomas.hoger@xxxxxxxxx>
Subject: Re: Broken ldirectord reload
Cc: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
From: Horms <horms@xxxxxxxxxxxx>
Date: Fri, 16 Mar 2007 17:08:23 +0900
On Fri, Mar 16, 2007 at 08:50:53AM +0100, Roberto Nibali wrote:
> Hello,
> 
> I've cc'd Horms, since that's the way to get his attention regarding 
> ldirectord 
> patches. He's insanely busy, so you need some patience.
> 
> 
> >ldirectord (version 1.186/1.42) does not seem to handle reloads
> >correctly.   After reload, some parameters for virtual server in its
> >hash are left uninitialized (e.g. $$v{proto}).  As the result, service
> >checking does not work correctly any more and ldirectord is attempting
> >to run ipvsadm with invalid list of arguments.
> 
> Does this happen in case the:
> 
> 1. old configuration == new configuration?
> 2. old configuration contains more VIPs or RIPs than new configuration?
> 3. old configuration contains less VIPs or RIPs than new configuration?
> 4. old configuration is almost completely different compared to new 
> configuration?
> 
> >Missing parameters are normally initialized in ld_setup function.
> >This function is not called during reload.  Adding ld_setup call to
> >reread_config seems to fix the issue.  Possible fix:
> >--- /usr/sbin/ldirectord.orig   2007-02-12 23:06:29.000000000 +0100
> >+++ /usr/sbin/ldirectord        2007-03-14 12:08:36.000000000 +0100
> >@@ -917,6 +917,8 @@
> >               &ld_cmd_children("stop", %STOP);
> >               &ld_cmd_children("reload_or_start", %RELOAD);
> >               &ld_cmd_children("start", %START);
> >+
> >+               &ld_setup();
> >       };
> >       if ($@) {
> >               @VIRTUAL = @OLDVIRTUAL;
> >Can anyone more familiar with ldirectord internals review such fix and
> >point out potential problems?
> 
> I'm not very familiar with ldirectord, although I've dug through it in
> the past. However, your fix seems appropriate. Nevertheless, I find it
> somewhat interesting that you're the first one hitting this issue, as
> if noone ever reloaded ldirectord :). It's clear that when reloading
> (sending SIGHUP to the $PID) ld_setup() is not explicitly called
> anymore.
> 
> Is your old $PID available when this happens? Could it be a signaling
> issue?  Can you also check the pending signals with ps as when it
> comes to a reload and your problem is exhibited? I'm just asking
> because there is a lot of potentially CPU-intensive stuff being
> processed during the SIGHUP interrupt handler in ldirectord. Otherwise
> I'd say that your patch look sane.

I think that the patch looks sane too. But I am also quite surprised
as I have tested the reload behaviour myself on several occasions.
I guess something slipped through the cracks, but Thomas,
would it be possible for you to provide a test case?

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


<Prev in Thread] Current Thread [Next in Thread>