<div dir="ltr">Hi Michael,<div><br></div><div>Yes, it's a similar issue but different aspect. Actually, the case for l2gw is worse, considering we have to deal with 2 existing back-end driver which have different understanding for the interfaces. But I think the proposed approach for networking-ovn is inspiring and helpful for l2gw. </div><div><br></div><div>Thanks,</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 8, 2017 at 11:59 PM, Michael Bayer <span dir="ltr"><<a href="mailto:mbayer@redhat.com" target="_blank">mbayer@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Dec 6, 2017 at 3:46 AM, Peng Liu <<a href="mailto:pliu@redhat.com">pliu@redhat.com</a>> wrote:<br>
> Hi,<br>
><br>
> During working on this patch[0], I encounter some DB out-of-sync problem. I<br>
> think maybe the design can be improved. Here is my thought, all comments are<br>
> welcome.<br>
<br>
<br>
</span>see also <a href="https://review.openstack.org/#/c/490834/" rel="noreferrer" target="_blank">https://review.openstack.org/#<wbr>/c/490834/</a> which I think is<br>
dealing with a similar (if not the same) issue.<br>
<div><div class="h5"><br>
><br>
> In plugin code, I found all the resource operations follow the pattern in<br>
> [1]. It is a very misleading design compare to [2].<br>
><br>
> "For every action that can be taken on a resource, the mechanism driver<br>
> exposes two methods - ACTION_RESOURCE_precommit, which is called within the<br>
> database transaction context, and ACTION_RESOURCE_postcommit, called after<br>
> the database transaction is complete."<br>
><br>
> In result, if we focus on the out-of-sync between plugin DB and<br>
> driver/backend DB:<br>
><br>
> 1) In RPC driver, only methods Action_Resource and are implemented. Which<br>
> means the action is token before it was written in plugin DB. In case of<br>
> action partial succeed (especially for update case) or plugin DB operation<br>
> failure, it will cause DB out-of-sync.<br>
> 2) In ODL driver, only methods Action_Resource_postcommit are implemented,<br>
> which means there is no validation in ODL level before the record is written<br>
> in the plugin DB. In case of, ODL side failure, there is no rollback for<br>
> plugin DB.<br>
><br>
> So, to fix this issue is costly. Both plugin and driver sides need to be<br>
> altered.<br>
><br>
> The other side of this issue is a period db monitor mechanism between plugin<br>
> and drivers, and it is another story.<br>
><br>
><br>
> [0] <a href="https://review.openstack.org/#/c/516256" rel="noreferrer" target="_blank">https://review.openstack.org/#<wbr>/c/516256</a><br>
> [1]<br>
> ...<br>
>     def Action_Resource<br>
>         self.validate_Resource_for_<wbr>Action<br>
>         self.driver.Action_Resource<br>
>         with context.session.begin(<wbr>subtransactions=True):<br>
>             super.Action_Resource<br>
>             self.driver.Action_Resource_<wbr>precommit<br>
>         try:<br>
>             self.driver.Action_Resource_<wbr>postcommit<br>
> ...<br>
> [2] <a href="https://wiki.openstack.org/wiki/Neutron/ML2" rel="noreferrer" target="_blank">https://wiki.openstack.org/<wbr>wiki/Neutron/ML2</a><br>
><br>
> --<br>
> Peng Liu<br>
><br>
</div></div>> ______________________________<wbr>______________________________<wbr>______________<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.<wbr>openstack.org?subject:<wbr>unsubscribe</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/<wbr>cgi-bin/mailman/listinfo/<wbr>openstack-dev</a><br>
><br>
<br>
______________________________<wbr>______________________________<wbr>______________<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.<wbr>openstack.org?subject:<wbr>unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/<wbr>cgi-bin/mailman/listinfo/<wbr>openstack-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><font face="arial, helvetica, sans-serif" size="2">Peng Liu | Senior Software Engineer</font><div><font face="arial, helvetica, sans-serif" size="2"><br>Tel: +</font><span style="font-size:12.8px">86 10 62608046</span><font face="arial, helvetica, sans-serif" size="2"> (direct)<br>Mobile: +86 13801193245</font></div><div><font face="arial, helvetica, sans-serif" size="2"><br>Red Hat Software (Beijing) Co., Ltd.<br><span style="color:rgb(0,0,0)">9/F, North Tower C, </span></font><div><font face="arial, helvetica, sans-serif" size="2"><span style="color:rgb(0,0,0)">Raycom Infotech Park, </span></font></div><div><font face="arial, helvetica, sans-serif" size="2"><span style="color:rgb(0,0,0)">No.2 Kexueyuan Nanlu, Haidian District, </span></font></div><div><font face="arial, helvetica, sans-serif" size="2"><span style="color:rgb(0,0,0)">Beijing, China, POC 100190</span></font><br></div></div></div></div></div></div>
</div>