LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] Patch for ldirectord when using mysql service

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] Patch for ldirectord when using mysql service
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Mon, 29 Oct 2007 15:36:45 +0900
On Fri, Oct 26, 2007 at 09:15:20PM +0200, Sverre Marvik wrote:
> My first go at this mailing list, hope this is the place to post a
> patch...
> 
> We're using a 2-server-cluster LVS and HA setup to have a loadbalanced
> high available MySQL database server.
> Currently running CentOS 5.0, MySQL 5.0.22 and the heartbeat packages
> version 2.1.2.
> 
> We've been having some trouble getting ldirectord doing it's work when
> it comes to adding real servers to the VIP host. The real-servers failed
> due to errors in the ldirectord when checking the database with a
> provided SELECT query. To get this working, we had to fix 2 very small
> problem in ldirectord, in the check_sql method.
> 
> Ldirectord version string is "Linux Director v1.186-ha-2.1.2"
> 
> The patch:
> --- /usr/sbin/ldirectord.org    2007-08-10 13:03:07.000000000 +0200
> +++ /usr/sbin/ldirectord        2007-10-25 14:48:20.000000000 +0200
> @@ -2672,7 +2672,7 @@
>                             $$v{passwd});
>         unless ($dbh) {
>                 check_sql_log_errstr("Failed to bind to $$r{server}
> with",
> -                                    $dbh->errstr);
> +                                    DBI->errstr);
>                 goto err_down;
>         }
>         $result--;
> @@ -2728,7 +2728,8 @@
>         # at a particular row. But I'm not going to worry about that for
>         # now.
>         $row = $sth->fetchrow_arrayref;
> -       unless ($row && $sth->err) {
> +        # We don't want "unless $sth->err", this will only kick in when
> error is NOT set
> +       unless ($row && !$sth->err) {
>                 check_sql_log_errstr("Error fetching row:",
> $dbh->errstr);
>                 goto err_finish;
>         }

Hi,

Thanks for bringing this to my attention.  I have committed this change
and it should appear in the next release of linux-ha (which includes
ldirectord).

http://hg.linux-ha.org/dev/rev/b2f562475eae

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



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