Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

15 views
Skip to first unread message

Doug Barton

unread,
Sep 23, 2009, 2:42:40 AM9/23/09
to bind-...@isc.org
I recently added DLZ options to the BIND ports on FreeBSD, and a user
has filed the following problem report:
http://www.freebsd.org/cgi/query-pr.cgi?pr=139051

Does anyone have any comment on the patch suggested at the URL in the
PR?
http://www.shell-tips.com/2007/09/04/bind-950-patch-dlz-mysql-5-for-auto-reconnect/

Is this something that is likely to be included in a BIND distribution
any time soon?


Thanks,

Doug

Mark Andrews

unread,
Sep 23, 2009, 3:19:57 AM9/23/09
to Doug Barton, bind-...@isc.org

Reconnect is already being set.

B.T.W. the patch passes a pointer to the wrong type to mysql_options()
see http://dev.mysql.com/doc/refman/5.1/en/mysql-options.html

> Thanks,
>
> Doug
> _______________________________________________
> bind-users mailing list
> bind-...@lists.isc.org
> https://lists.isc.org/mailman/listinfo/bind-users
--
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742 INTERNET: ma...@isc.org

Doug Barton

unread,
Sep 23, 2009, 1:46:21 PM9/23/09
to Mark Andrews, bind-...@isc.org
Mark Andrews wrote:
> In message <4AB9C360...@dougbarton.us>, Doug Barton writes:
>> I recently added DLZ options to the BIND ports on FreeBSD, and a user
>> has filed the following problem report:
>> http://www.freebsd.org/cgi/query-pr.cgi?pr=139051
>>
>> Does anyone have any comment on the patch suggested at the URL in the
>> PR?
>> http://www.shell-tips.com/2007/09/04/bind-950-patch-dlz-mysql-5-for-auto-recon
>> nect/
>>
>> Is this something that is likely to be included in a BIND distribution
>> any time soon?
>
> Reconnect is already being set.
>
> B.T.W. the patch passes a pointer to the wrong type to mysql_options()
> see http://dev.mysql.com/doc/refman/5.1/en/mysql-options.html

Thanks Mark. I've asked the user to follow up on this list so that
hopefully we can reach a conclusion on the right solution.


Doug

Mark Andrews

unread,
Sep 25, 2009, 11:20:33 PM9/25/09
to Emil Smolenski, bind-...@lists.isc.org

In message <20090925184...@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

Emil Smolenski

unread,
Sep 26, 2009, 10:58:37 AM9/26/09
to Mark Andrews, Doug Barton, bind-...@lists.isc.org
On Sat, 26 Sep 2009 05:20:33 +0200, Mark Andrews <ma...@isc.org> 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.

I see now. Thank you for explanation. Is there a correct patch for 9.6.1?
If not, could you help to prepare such patch?

--
am

Emil Smolenski

unread,
Dec 13, 2009, 11:33:58 AM12/13/09
to Mark Andrews, bind-...@lists.isc.org
On Sat, 26 Sep 2009 05:20:33 +0200, Mark Andrews <ma...@isc.org> wrote:

So why has it recently changed? I was confused previously, because I
didn't find it defined anywhere.

$ diff bind-9.7.0a3/contrib/dlz/drivers/dlz_mysql_driver.c \
bind-9.7.0rc1/contrib/dlz/drivers/dlz_mysql_driver.c
795c795
< #ifdef MYSQL_OPT_RECONNECT
---
> #if MYSQL_VERSION_ID >= 50000
929c929
< #ifdef MYSQL_OPT_RECONNECT
---
> #if MYSQL_VERSION_ID >= 50000

--
am

0 new messages