BIND with DLZ doesn't reconnect to the MySQL 5.x server after?disconnect

Mark Andrews marka at isc.org
Sat Sep 26 03:20:33 UTC 2009


In message <20090925184532.CF9CC790 at raisa.eu.org>, Emil Smolenski writes:
> Mark Andrews wrote:
> 
> > Reconnect is already being set.
> 
>  Hello. Indeed, I found following message in release notes of BIND
> 9.6.1-P1 ( http://oldwww.isc.org/sw/bind/view/?release=9.6.1-P1 ):

Which you should have seen came *after* 9.6.1 was released.
The CHANGES file is in reverse chronological order.

2581.   [contrib]       dlz/mysql set MYSQL_OPT_RECONNECT option on connection.
                        Requires MySQL 5.0.19 or later. [RT #19084]

2580.   [bug]           UpdateRej statistics counter could be incremented twice
                        for one rejection. [RT #19476]

        --- 9.6.1 released ---

> dlz/mysql set MYSQL_OPT_RECONNECT option on connection. Requires MySQL
> 5.0.19 or later. [RT #19084]
> 
>  But there is no output from the second command:
> 
> $ tar xf bind-9.6.1-P1.tar.gz
> $ grep -r MYSQL_OPT_RECONNECT bind-9.6.1-P1
> $
> 
>  I've tested it. BIND still doesn't reconnect. After applying patch
> mentioned earlier, BIND starts to work properly.
> 
> I believe this patch should be commited (as is committed in 9.7.0a3):
> 
> $ diff bind-9.7.0a3/contrib/dlz/drivers/dlz_mysql_driver.c \
>    bind-9.6.1-P1/contrib/dlz/drivers/dlz_mysql_driver.c
> 795,797d794
> < #ifdef MYSQL_OPT_RECONNECT
> <         my_bool auto_reconnect = 1;
> < #endif
> 929,939d925
> < #ifdef MYSQL_OPT_RECONNECT
> <       /* enable automatic reconnection. */
> <         if (mysql_options((MYSQL *) dbi->dbconn, MYSQL_OPT_RECONNECT,
> <                         &auto_reconnect) != 0) {
<               isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
> <                             DNS_LOGMODULE_DLZ, ISC_LOG_WARNING,
> <                             "mysql driver failed to set "
> <                             "MYSQL_OPT_RECONNECT option, continuing");
> <       }
> < #endif
> 
>  BTW, why there are only #ifdefs without #define in 9.7.0a3? Is user
> forced to set this option himself to make it work?

No.  MYSQL_OPT_RECONNECT is only in some versions of mysql.  If you have
a version which supports MYSQL_OPT_RECONNECT then MYSQL_OPT_RECONNECT will
be defined.

Mark
 
> -- 
> am
-- 
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: marka at isc.org



More information about the bind-users mailing list