<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 25, 2012 at 5:17 PM, Vishvananda Ishaya <span dir="ltr"><<a href="mailto:vishvananda@gmail.com" target="_blank">vishvananda@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">The main issue is when the relevant tables are moved into a separate service a la quantum or cinder.  We can't keep referential integrity across multiple databases, so the foreign keys in this case need to be removed. It leads to an odd situation when there is still an internal implementation in addition to the external implementation because the internal implementation no longer has foreign keys.</div>
</blockquote><div><br></div><div>Sure, there's little you can do in that case. I thought the OP was talking about 2 tables in the same database that were already set up with a foreign key relationship, with the referential integrity checks disabled.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>As an example, we used to have foreign key relationships between instances and networks.  We can no longer have these because we support networks declared externally.  The internal network management now has no referential integrity, but this is the price we pay for separation of concerns.  We are going through a similar set of relationship-breaking with the volume code.</div>
</div></blockquote><div><br></div><div>Right, those references should be via UUID rather than the integer keys (if the reference is still needed at all).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div> </div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>
Vish</div><div><br><div><div><div class="h5"><div>On Apr 25, 2012, at 11:02 AM, Doug Hellmann wrote:</div><br></div></div><blockquote type="cite"><div><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Apr 25, 2012 at 7:38 AM, Andrew Hutchings <span dir="ltr"><<a href="mailto:andrew@linuxjedi.co.uk" target="_blank">andrew@linuxjedi.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 12/04/12 13:35, J. Daniel Schmidt wrote:<br>
> While testing our SUSE OpenStack packages we hit a nasty bug and reported it<br>
> as:  <a href="https://bugs.launchpad.net/keystone/+bug/972502" target="_blank">https://bugs.launchpad.net/keystone/+bug/972502</a><br>
><br>
> We found out that the underlying cause was a lack of referential integrity[1]<br>
> using sqlite or mysql. When we tried to reproduce this issue on postgresql the<br>
> usage of foreign keys greatly helped to find the cause.<br>
<br>
</div>>From a MySQL prospective that is probably more of an argument to use<br>
transactions, not foreign keys.<br></blockquote><div><br></div><div>Transactions and referential integrity are related, but not equivalent. Without referential integrity it's quite easy to commit a transaction that leaves the database in a logically inconsistent state (it sounds like that's what was happening in the case described by the OP).</div>

<div><br></div><div>Is there a technical reason to disable strict referential integrity checking with MySQL?</div><div><br></div><div>Doug</div><div><br></div></div></div></div></div><div class="im">
_______________________________________________<br>Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>Post to     : <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
</div></blockquote></div><br></div></div></blockquote></div><br></div>