<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div><br>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div>
<div>On 3/20/15, 8:31 PM, "Salvatore Orlando" <<a href="mailto:sorlando@nicira.com">sorlando@nicira.com</a>> wrote:</div>
</div>
<div><br>
</div>
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div>
<div>
<div dir="ltr">
<div><br>
</div>
<div>As the IPAM driver is called in <font color="#010181"><span style="font-size:14px">NeutronDbPluginV2, this call happens while another transaction is typically in progress. Initiating a separate session within the IPAM driver causes the outer transaction
 to fail.</span></font><br>
</div>
<div><font color="#010181"><span style="font-size:14px">I do not think there is a lot we can do about this at the moment, unless we agree on a more pervasive refactoring:</span></font></div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
</div>
</blockquote>
</span>
<div>
<div><br>
</div>
<div>This is essentially what is described in the "Refactoring" section of the spec [1] (see the third paragraph in that section specifically). The original expectation (as you say) was that we would be able to achieve this by only changing the DB plugin, but
 this looks to not be feasible at this point given the way sessions are handled in the subclasses.</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div>
<div>
<div dir="ltr">
<div><br>
</div>
<div>Otherwise, we'd just made the IPAM driver session aware. This implies changes to the Pool and Subnet interface to accept an optional session parameter.</div>
<div>The above works and is probably quicker from an implementation perspective. However, doing so somehow represents a failure of the pluggable IPAM effort as total separation between IPAM and API operation processing was one of our goals.
</div>
</div>
</div>
</div>
</blockquote>
</span>
<div><br>
</div>
<div>
<div>Actually, I don't see this as a big deal or a failure. In fact, it may be quite common and useful for a given driver to store some state in its own tables (like the reference driver is doing). The primary goal is to enable alternate IPAM implementations,
 whether external or completely local. That goal is still achieved even with this change. So, I don't see a big problem with the IPAM driver being session-aware.</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div>
<div>
<div dir="ltr">
<div>Also, for drivers with a remote backend, remote calls will be made within a DB transaction, which is another thing we wanted to avoid.</div>
</div>
</div>
</div>
</blockquote>
</span>
<div><br>
</div>
<div>This is more of a concern, due to the issue with the mysql connector. I guess I'd like to understand better what that issue is and how we may resolve it, since it is a source of pain not just for IPAM.</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div>
<div>
<div dir="ltr">
<div><br>
</div>
<div>And finally, there is the third option. I know IPAM contributors do not even want to hear it... but the third option is to enjoy 6 more months to come up with a better implementation which does not add any technical debt. In Kilo from the IPAM side we're
 already introducing subnet pools, so it won't be a total failure!</div>
</div>
</div>
</div>
</blockquote>
</span>
<div><br>
</div>
<div>I think we can still handle the primary use case without adding technical debt. We had hoped to *re-pay* more technical debt with the refactor than we are able to achieve, but I don't see any additional debt by making the driver session-aware.</div>
<div><br>
</div>
<div>John</div>
<div><br>
</div>
<div>[1] http://specs.openstack.org/openstack/neutron-specs/specs/kilo/neutron-ipam.html</div>
<span id="OLK_SRC_BODY_SECTION">
<div>
<div>
<div class="gmail_extra">
<div class="gmail_quote">
<div dir="ltr">
<div class="gmail_extra"><br>
</div>
</div>
</div>
</div>
</div>
</div>
</span>
</body>
</html>