<div dir="ltr">It sounds like something is starting a transaction before calling update_port on the core plugin. This will prevent the transaction from being completely closed even though ML2 is in the post_commit phase.<div><br></div><div>In your db.get_port call, make sure you are using the same DB session from the context that was passed into update_port_postcommit and that will make sure you always have access to the current state even if the transaction isn't closed.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 7, 2015 at 5:35 AM, Neil Jerram <span dir="ltr"><<a href="mailto:Neil.Jerram@metaswitch.com" target="_blank">Neil.Jerram@metaswitch.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I think there's something I'm not understanding about how Neutron's DB tables are related, and when one can safely read believed-to-be-committed information from them...<br>
<br>
My project's mechanism driver is handling a port update in which the fixed IPs are changing; specifically, a second fixed IP has been added to the port.  It does this (for a reason I can explain if needed) by calling db.get_port(), in the update_port_postcommit hook.<br>
<br>
But we observe that the result of db.get_port() does not include the new fixed IP.  Even though we're in the postcommit hook, and hence we assume that all the changes for that port have by now been committed.<br>
<br>
What are we misunderstanding here?  My guess is that this is something to do with 'fixed_ips' not being a column directly in the Ports table, but instead calculated from relationships between the port ID and another (IPAllocation) table.  We've seen a similar problem in the past with binding:host_id, for which the same is true, i.e. info is in the separate portbindings table.<br>
<br>
Or could it be that the transaction hasn't really been closed yet, when update_port_postcommit hook is called?<br>
<br>
(This is with Icehouse-level code, so it could be something that's been fixed...)<br>
<br>
Many thanks,<br>
        Neil<br>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div>Kevin Benton</div></div>
</div>