<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.6.6">
</HEAD>
<BODY>
Many thanks, Marcin, for your answer. Meanwhile I downgraded to 1.4.0-P1 version and it works perfectly. I'll try 1.5.0 version with the workaround soon.<BR>
<BR>
Regards, Fernando.<BR>
<BR>
-----Mensaje original-----<BR>
<B>De</B>: Marcin Siodelski <<A HREF="mailto:Marcin%20Siodelski%20%3cmarcin@isc.org%3e">marcin@isc.org</A>><BR>
<B>Para</B>: Fernando Ruza Rodriguez <<A HREF="mailto:Fernando%20Ruza%20Rodriguez%20%3cfernandor@sescam.jccm.es%3e">fernandor@sescam.jccm.es</A>>, <A HREF="mailto:Kea-users@lists.isc.org">Kea-users@lists.isc.org</A><BR>
<B>Asunto</B>: Re: [Kea-users] Kea 1.5 with MySQL Cluster<BR>
<B>Fecha</B>: Mon, 6 May 2019 14:41:22 +0200<BR>
<BR>
<PRE>
Fernando,

As it is stated in the Kea 1.5.0 documentation, the tables you have
issues with are unused in this release. They will be used in Kea 1.6.0.
Therefore, as long as you're using Kea 1.5.0, I see no issue with using
the workaround you're proposing.

Please note that I've created a new Kea ticket:
<A HREF="https://gitlab.isc.org/isc-projects/kea/issues/593">https://gitlab.isc.org/isc-projects/kea/issues/593</A> to consider the code
and/or schema changes to better facilitate cases like yours and possibly
remove the UPDATE CASCADE, but that has to be discussed between the Kea
developers first.

Marcin Siodelski
DHCP Software Engineer,
ISC



On 29/04/2019 12:41, Fernando Ruza Rodriguez wrote:
<FONT COLOR="#737373">> Hi again!</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> I've read in the kea 1.5.0 release notes:</FONT>
<FONT COLOR="#737373">> <A HREF="https://ftp.isc.org/isc/kea/1.5.0/Kea150ReleaseNotes.txt">https://ftp.isc.org/isc/kea/1.5.0/Kea150ReleaseNotes.txt</A> the following:</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> /**Configuration Backend design** - The Configuration Backend feature is /</FONT>
<FONT COLOR="#737373">> /now planned for Kea 1.6.0. It will provide the ability to use a</FONT>
<FONT COLOR="#737373">> database as /</FONT>
<FONT COLOR="#737373">> /a source of configuration information for the Kea DHCP servers. Even</FONT>
<FONT COLOR="#737373">> though /</FONT>
<FONT COLOR="#737373">> /the Configuration Backend is not functional in the Kea 1.5.0 release, the /</FONT>
<FONT COLOR="#737373">> /design for this feature was created and some basic elements implementing /</FONT>
<FONT COLOR="#737373">> /this design are included in the current version. The most prominent</FONT>
<FONT COLOR="#737373">> change /</FONT>
<FONT COLOR="#737373">> /is the update of the MySQL schema to include new tables, constraints and /</FONT>
<FONT COLOR="#737373">> /indexes to be used by the Configuration Backend feature once it is /</FONT>
<FONT COLOR="#737373">> /implemented. These elements are currently unused, but they will be</FONT>
<FONT COLOR="#737373">> created /</FONT>
<FONT COLOR="#737373">> /in the existing database instances once the MySQL database is upgraded to /</FONT>
<FONT COLOR="#737373">> /the version supported by Kea 1.5.0 release. The design of the</FONT>
<FONT COLOR="#737373">> Configuration /</FONT>
<FONT COLOR="#737373">> /Backend is available at /</FONT>
<FONT COLOR="#737373">> /<A HREF="https://gitlab.isc.org/isc-projects/kea/wikis/designs/configuration-in-db-des/">https://gitlab.isc.org/isc-projects/kea/wikis/designs/configuration-in-db-des/</A></FONT>
<FONT COLOR="#737373">> /ign./</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> And I see in the "Kea Configuration Backend Design:</FONT>
<FONT COLOR="#737373">> <A HREF="https://gitlab.isc.org/isc-projects/kea/wikis/designs/configuration-in-db-design">https://gitlab.isc.org/isc-projects/kea/wikis/designs/configuration-in-db-design</A>"</FONT>
<FONT COLOR="#737373">> that the both tables what I'm having problems with MySQL NDB cluster are</FONT>
<FONT COLOR="#737373">> for this Configuration Backend feature that it's not used by kea version</FONT>
<FONT COLOR="#737373">> 1.5.0 yet. So, Could I obviate these tables and keep engine to innodb in</FONT>
<FONT COLOR="#737373">> them and still use kea version 1.5.0 in MySQL NDB cluster ?? What do you</FONT>
<FONT COLOR="#737373">> think ??.</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Thanks for any reply.</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Regards, Fernando.</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> -----Mensaje original-----</FONT>
<FONT COLOR="#737373">> *De*: Fernando Ruza Rodriguez <<A HREF="mailto:fernandor@sescam.jccm.es">fernandor@sescam.jccm.es</A></FONT>
<FONT COLOR="#737373">> <<A HREF="mailto:Fernando%20Ruza%20Rodriguez%20%3cfernandor@sescam.jccm.es">mailto:Fernando%20Ruza%20Rodriguez%20%3cfernandor@sescam.jccm.es</A>%3e>></FONT>
<FONT COLOR="#737373">> *Para*: <A HREF="mailto:Kea-users@lists.isc.org">Kea-users@lists.isc.org</A> <<A HREF="mailto:Kea-users@lists.isc.org">mailto:Kea-users@lists.isc.org</A>></FONT>
<FONT COLOR="#737373">> *Asunto*: Re: [Kea-users] Kea 1.6 with MySQL Cluster</FONT>
<FONT COLOR="#737373">> *Fecha*: Mon, 29 Apr 2019 11:53:53 +0200</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Sorry, I said kea version 1.6 and I wanted to say: *kea version 1.5*. It</FONT>
<FONT COLOR="#737373">> is a restriction regarding foreign keys and on update cascade:</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> <A HREF="https://dev.mysql.com/doc/mysql-cluster-excerpt/5.7/en/mysql-cluster-limitations-syntax.html">https://dev.mysql.com/doc/mysql-cluster-excerpt/5.7/en/mysql-cluster-limitations-syntax.html</A></FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> *Restrictions on foreign keys. * Support for foreign key constraints in</FONT>
<FONT COLOR="#737373">> NDB 7.5 is comparable to that provided by InnoDB</FONT>
<FONT COLOR="#737373">> <<A HREF="https://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html">https://dev.mysql.com/doc/refman/5.7/en/innodb-storage-engine.html</A>>,</FONT>
<FONT COLOR="#737373">> subject to the following restrictions:</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">>   * ON UPDATE CASCADE is not supported when the reference is to the</FONT>
<FONT COLOR="#737373">>     parent table's primary key.</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">>     This is because an update of a primary key is implemented as a</FONT>
<FONT COLOR="#737373">>     delete of the old row (containing the old primary key) plus an</FONT>
<FONT COLOR="#737373">>     insert of the new row (with a new primary key). This is not visible</FONT>
<FONT COLOR="#737373">>     to the NDB kernel, which views these two rows as being the same, and</FONT>
<FONT COLOR="#737373">>     thus has no way of knowing that this update should be cascaded.</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> I have downloaded and installed kea version 1.4.0-P1 and replaced in</FONT>
<FONT COLOR="#737373">> mysql script the engine from INNODB to NDBCLUSTER and now the database</FONT>
<FONT COLOR="#737373">> is created correctly.</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Thanks and regards,</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Fernando. </FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> -----Mensaje original-----</FONT>
<FONT COLOR="#737373">> *De*: Fernando Ruza Rodriguez <<A HREF="mailto:fernandor@sescam.jccm.es">fernandor@sescam.jccm.es</A></FONT>
<FONT COLOR="#737373">> <<A HREF="mailto:Fernando%20Ruza%20Rodriguez%20%3cfernandor@sescam.jccm.es">mailto:Fernando%20Ruza%20Rodriguez%20%3cfernandor@sescam.jccm.es</A>%3e>></FONT>
<FONT COLOR="#737373">> *Para*: <A HREF="mailto:Kea-users@lists.isc.org">Kea-users@lists.isc.org</A> <<A HREF="mailto:Kea-users@lists.isc.org">mailto:Kea-users@lists.isc.org</A>></FONT>
<FONT COLOR="#737373">> *Asunto*: [Kea-users] Kea 1.6 with MySQL Cluster</FONT>
<FONT COLOR="#737373">> *Fecha*: Fri, 26 Apr 2019 14:55:19 +0200</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Hi, I'm trying to setup kea 1.6 with MySQL NDB Cluster backend. Has</FONT>
<FONT COLOR="#737373">> someone experienced with them?</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> I have changed the "ENGINE" in all create tables statements with</FONT>
<FONT COLOR="#737373">> ENGINE=NDBCLUSTER in the script dhcpdb_create.mysql however when I run</FONT>
<FONT COLOR="#737373">> it I get the following errors, I think, when created the tables</FONT>
<FONT COLOR="#737373">> keadhcp.dhcp4_pool and keadhcp.dhcp6_pool for the foreign keys they have:</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> ...</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> ERROR 1215 (HY000): Cannot add foreign key constraint</FONT>
<FONT COLOR="#737373">> Query OK, 0 rows affected (0,46 sec)</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Query OK, 0 rows affected (1,50 sec)</FONT>
<FONT COLOR="#737373">> Records: 0  Duplicates: 0  Warnings: 0</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Query OK, 0 rows affected (1,77 sec)</FONT>
<FONT COLOR="#737373">> Records: 0  Duplicates: 0  Warnings: 0</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Query OK, 0 rows affected (0,48 sec)</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> ERROR 1146 (42S02): Table 'keadhcp.dhcp4_pool' doesn't exist</FONT>
<FONT COLOR="#737373">> Query OK, 0 rows affected (0,48 sec)</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> ...</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> ERROR 1215 (HY000): Cannot add foreign key constraint</FONT>
<FONT COLOR="#737373">> ERROR 1215 (HY000): Cannot add foreign key constraint</FONT>
<FONT COLOR="#737373">> Query OK, 0 rows affected (1,65 sec)</FONT>
<FONT COLOR="#737373">> Records: 0  Duplicates: 0  Warnings: 0</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Query OK, 0 rows affected (1,36 sec)</FONT>
<FONT COLOR="#737373">> Records: 0  Duplicates: 0  Warnings: 0</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Query OK, 0 rows affected (0,57 sec)</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> ERROR 1146 (42S02): Table 'keadhcp.dhcp6_pool' doesn't exist</FONT>
<FONT COLOR="#737373">> Query OK, 1 row affected (0,03 sec)</FONT>
<FONT COLOR="#737373">> Rows matched: 1  Changed: 1  Warnings: 0</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Thanks in advanced for any help.</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Regards, Fernando.</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> _______________________________________________</FONT>
<FONT COLOR="#737373">> Kea-users mailing list</FONT>
<FONT COLOR="#737373">> <A HREF="mailto:Kea-users@lists.isc.org">Kea-users@lists.isc.org</A> <<A HREF="mailto:Kea-users@lists.isc.org">mailto:Kea-users@lists.isc.org</A>></FONT>
<FONT COLOR="#737373">> <A HREF="https://lists.isc.org/mailman/listinfo/kea-users">https://lists.isc.org/mailman/listinfo/kea-users</A></FONT>
<FONT COLOR="#737373">> _______________________________________________</FONT>
<FONT COLOR="#737373">> Kea-users mailing list</FONT>
<FONT COLOR="#737373">> <A HREF="mailto:Kea-users@lists.isc.org">Kea-users@lists.isc.org</A> <<A HREF="mailto:Kea-users@lists.isc.org">mailto:Kea-users@lists.isc.org</A>></FONT>
<FONT COLOR="#737373">> <A HREF="https://lists.isc.org/mailman/listinfo/kea-users">https://lists.isc.org/mailman/listinfo/kea-users</A></FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> _______________________________________________</FONT>
<FONT COLOR="#737373">> Kea-users mailing list</FONT>
<FONT COLOR="#737373">> <A HREF="mailto:Kea-users@lists.isc.org">Kea-users@lists.isc.org</A></FONT>
<FONT COLOR="#737373">> <A HREF="https://lists.isc.org/mailman/listinfo/kea-users">https://lists.isc.org/mailman/listinfo/kea-users</A></FONT>
<FONT COLOR="#737373">> </FONT>

</PRE>
</BODY>
</HTML>