<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Numan,<div class=""><br class=""></div><div class="">Thanks for the proposal. We have also been thinking about this use-case.<br class=""><div class=""><br class=""></div><div class="">If I’m reading this accurately (and I may not be), it seems that the proposal is to not have any OVN NB (CUD) operations (R operations outside the scope) done by the api_worker threads but rather by a new journal thread.</div><div class=""><br class=""></div><div class="">If this is indeed the case, I’d like to consider the scenario when there any N neutron nodes, each node with M worker threads. The journal thread at the each node contain list of pending operations. Could there be (sequence) dependency in the pending operations amongst each the journal threads in the nodes that prevents them from getting applied (for e.g. Logical_Router_Port and Logical_Switch_Port inter-dependency), because we are returning success on neutron operations that have still not been committed to the NB DB.</div><div class=""><br class=""></div><div class="">Couple of clarifications and thoughts below.</div><div class=""><br class=""></div><div class="">Thanks</div><div class="">Amitabha <<a href="mailto:abiswas@us.ibm.com" class="">abiswas@us.ibm.com</a>></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 13, 2016, at 1:20 AM, Numan Siddique <<a href="mailto:nusiddiq@redhat.com" class="">nusiddiq@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_default"><font face="arial, helvetica, sans-serif" class="">Adding the proper tags in subject</font></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Jul 13, 2016 at 1:22 PM, Numan Siddique <span dir="ltr" class=""><<a href="mailto:nusiddiq@redhat.com" target="_blank" class="">nusiddiq@redhat.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class=""><div class=""><font face="arial, helvetica, sans-serif" class="">Hi Neutrinos,<br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">Presently, In the OVN ML2 driver we have 2 ways to sync neutron DB and OVN DB</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""> - At neutron-server startup, OVN ML2 driver syncs the neutron DB and OVN DB if sync mode is set to repair.</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""> - Admin can run the "neutron-ovn-db-sync-util" to sync the DBs.</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">Recently, in the v2 of networking-odl ML2 driver (Please see (1) below which has more details). (ODL folks please correct me if I am wrong here)</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">  - a journal thread is created which does the CRUD operations of neutron resources asynchronously (i.e it sends the REST APIs to the ODL controller).</font></div></div></div></blockquote></div></div></div></div></blockquote><br class="">Would this be the equivalent of making OVSDB transactions to the OVN NB DB?</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class=""><div class=""><font face="arial, helvetica, sans-serif" class="">  - a maintenance thread is created which does some cleanup periodically and at startup does full sync if it detects ODL controller cold reboot.</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">Few question I have</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""> - can OVN ML2 driver take same or similar approach. Are there any advantages in taking this approach ? One advantage is neutron resources can be created/updated/deleted even if the OVN ML2 driver has lost connection to the ovsdb-server. The journal thread would eventually sync these resources in the OVN DB. I would like to know the communities thoughts on this.</font></div></div></div></blockquote></div></div></div></div></blockquote><div><br class=""></div>If we can make it work, it would indeed be a huge plus for system wide upgrades and some corner cases in the code (ACL specifically), where the post_commit relies on all transactions to be successful and doesn’t revert the neutron db if something fails.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class=""><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""> - Are there are other ML2 drivers which might have to handle the DB sync's (cases where the other controllers also maintain their own DBs) and how they are handling it ?</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""> - Can a common approach be taken to sync the neutron DB and controller DBs ?</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">-----------------------------------------------------------------------------------------------------------</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">(1)</font></div><div class=""><font face="arial, helvetica, sans-serif" class="">Sync threads created by networking-odl ML2 driver</font></div><div class=""><font face="arial, helvetica, sans-serif" class="">--------------------------------------------------</font></div><div class=""><font face="arial, helvetica, sans-serif" class="">ODL ML2 driver creates 2 threads (threading.Thread module) at init</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""> - Journal thread</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""> - Maintenance thread</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">Journal thread</font></div><div class=""><font face="arial, helvetica, sans-serif" class="">----------------</font></div><div class=""><font face="arial, helvetica, sans-serif" class="">The journal module creates a new journal table by name “opendaylightjournal”  - <a href="https://github.com/openstack/networking-odl/blob/master/networking_odl/db/models.py#L23" target="_blank" class="">https://github.com/openstack/networking-odl/blob/master/networking_odl/db/models.py#L23</a></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">Journal thread will be in loop waiting for the sync event from the ODL ML2 driver.</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""> - ODL ML2 driver resource (network, subnet, port) precommit functions when called by the ML2 plugin adds an entry in the “opendaylightjournal” table with the resource data and sets the journal operation state for this entry to “PENDING”.</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""> - The corresponding resource postcommit function of the ODL ML2 plugin when called, sets the sync event flag.</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""> - A timer is also created which sets the sync event flag when it expires (the default value is 10 seconds).</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""> - Journal thread wakes up, looks into the “opendaylightjournal” table with the entries with state “pending” and runs the CRUD operation on those resources in the ODL DB. Once done, it sets the state to “completed”.</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">Maintenance thread</font></div><div class=""><font face="arial, helvetica, sans-serif" class="">------------------</font></div><div class=""><font face="arial, helvetica, sans-serif" class="">Maintenance thread does 3 operations</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""> - JournalCleanup - Delete completed rows from journal table “opendaylightjournal”.</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""> - CleanupProcessing - Mark orphaned processing rows to pending.</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""> - Full sync - Re-sync when detecting an ODL "cold reboot”.</font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, helvetica, sans-serif" class="">Thanks</font></div><span class="HOEnZb"><font color="#888888" class=""><div class=""><font face="arial, helvetica, sans-serif" class="">Numan</font></div><div style="font-family:monospace,monospace" class=""><br class=""></div></font></span></div></div>
</blockquote></div><br class=""></div></div>
__________________________________________________________________________<br class="">OpenStack Development Mailing List (not for usage questions)<br class="">Unsubscribe: <a href="mailto:OpenStack-dev-request@lists.openstack.org" class="">OpenStack-dev-request@lists.openstack.org</a>?subject:unsubscribe<br class=""><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" class="">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br class=""></div></blockquote></div><br class=""></div></div></body></html>