On Friday 07 April 2006 01:55, Frank Sweetser wrote:
> On Thu, Apr 06, 2006 at 09:36:39PM +0200, Kern Sibbald wrote:
> > On MySQL databases, Bacula *specifically* requests that MySQL not timeout
> > the connection.
> >
> > If this is only a problem with MySQL 5, then most likely MySQL has
> > changed something concerning timeouts, or has a bug.  Bacula has not
> > "officially" been tested with MySQL 5, which I still consider immature
> > (unstable if you will).
>
> I think I found it:
>
> http://dev.mysql.com/doc/refman/5.0/en/mysql-real-connect.html
>
> last paragraph:
>
> ---8<---
> Note that upon connection, mysql_real_connect() sets the reconnect flag
> (part of the MYSQL structure) to a value of 1 in versions of the API older
> than 5.0.3, or 0 in newer versions. A value of 1 for this flag indicates
> that if a statement cannot be performed because of a lost connection, to
> try reconnecting to the server before giving up. As of MySQL 5.0.13, you
> can use the MYSQL_OPT_RECONNECT option to mysql_options() to control
> reconnection behavior. ---8<---
>
> This implies to me that the disconnects have been happening all along, but
> because bacula set the reconnect flag, the database connection was silently
> restored.  If bacula were to ever support database level transactions, it's
> worth noting that using the reconnect flag will break transactions.

Bacula sets the mysql.reconnect flag to 1 prior to calling real_connect() so 
the above behavior  in versions greater than 5.0.3 (implemented by a bunch of 
idiots) explains the problem.

I wonder what you do in versions between 5.0.3 and 5.0.13.  I also wonder if 
MYSQL_OPT_RECONNECT is available or at least ignored on older versions. Sorry 
for the nasty comments, but the MySQL programmers are really not very 
cleaver.  

I'm not intending to put a lot of MySQL version detecting code in Bacula. 
Bacula already has enough of that kind of idiocy with Windows.  So, I would 
appreciate it if someone who is using one of the new broken versions of MySQL 
would research the issue enough to determine a reasonable way of working 
around this problem ...



-- 
Best regards,

Kern

  (">
  /\
  V_V


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to