LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: Broken ldirectord reload

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>, Horms <horms@xxxxxxxxxxxx>
Subject: Re: Broken ldirectord reload
From: Roberto Nibali <ratz@xxxxxxxxxxxx>
Date: Fri, 16 Mar 2007 08:50:53 +0100
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.

Best regards,
Roberto Nibali, ratz
--
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc

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