<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:36:18 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[OVSDB-406] Proper handling of json rpc transactions involving deletes particularly physical locators</title>
                <link>https://jira.opendaylight.org/browse/OVSDB-406</link>
                <project id="10158" key="OVSDB">ovsdb</project>
                    <description>&lt;p&gt;Today physical locator creation is driven from controller , but not deletion.&lt;br/&gt;
Physical locator can be deleted from the device database , when the device sees no references to it.&lt;/p&gt;

&lt;p&gt;This is posing some problems with subsequent creations.&lt;br/&gt;
When mcast mac1 is created along with locator1&lt;/p&gt;

&lt;p&gt;The operational datastore contains locator1 and its uuid.&lt;/p&gt;

&lt;p&gt;Now if the following updates come.&lt;br/&gt;
at time T1)Delete mcast mac1&lt;br/&gt;
at time T2)Insert mcast mac2 ( referring to locator1 )&lt;/p&gt;

&lt;p&gt;First odl controller will fire delete mcast mac1 to device.&lt;br/&gt;
The device acknowledges success for the transaction.&lt;/p&gt;

&lt;p&gt;In the background &lt;br/&gt;
The device also deletes locator1 as its only reference is gone and sends an update to the controller ( let us say this sending the delete update to controller is delayed by a sec ).&lt;/p&gt;

&lt;p&gt;Before that previous event happens if Insert mcast mac2 event comes, controller uses the uuid of locator1 to create mac2.&lt;br/&gt;
This insertion of mac2 fails with error saying such a foreign key does not exist.&lt;/p&gt;

&lt;p&gt;Controller has no clue that device is going to delete locator1 and went ahead used its uuid to create mac2 which resulted in this error.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="22098">OVSDB-406</key>
            <summary>Proper handling of json rpc transactions involving deletes particularly physical locators</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                                <status id="10004" iconUrl="https://jira.opendaylight.org/images/icons/status_generic.gif" description="">Verified</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="suneelu">suneelu varma</assignee>
                                    <reporter username="k.v.suneelu.verma@ericsson.com">suneel verma</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Mar 2017 10:01:52 +0000</created>
                <updated>Wed, 21 Mar 2018 17:39:29 +0000</updated>
                            <resolved>Wed, 21 Mar 2018 16:51:25 +0000</resolved>
                                    <version>Oxygen</version>
                                    <fixVersion>Oxygen</fixVersion>
                                    <component>Southbound.hw_vtep</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="41644" author="vishnoianil@gmail.com" created="Fri, 24 Mar 2017 20:13:05 +0000"  >&lt;p&gt;Hi Suneel,&lt;/p&gt;

&lt;p&gt;Do you have any specific approach to fix it ? How about if controller create the mcast mac2 first and then delete mac1 to avoid this situation? Will device throw error if the mac1 already exist for the physical locator?&lt;/p&gt;</comment>
                            <comment id="41645" author="k.v.suneelu.verma@ericsson.com" created="Mon, 27 Mar 2017 06:06:32 +0000"  >&lt;p&gt;How about if controller create the mcast mac2 first and then delete mac1 to avoid this situation?&lt;/p&gt;

&lt;p&gt;When mac1 delete event came , controller does know that it is going to be followed by insert of mac2 which uses some of the locators of mac1.&lt;/p&gt;

&lt;p&gt;It simply acts on the mac1 delete event. That way we cannot put it on hold.&lt;/p&gt;

&lt;p&gt;Moreover this situation can happen for other references of locators like , remote ucast macs and tunnels.&lt;/p&gt;</comment>
                            <comment id="41646" author="k.v.suneelu.verma@ericsson.com" created="Mon, 27 Mar 2017 06:17:03 +0000"  >&lt;p&gt;Two approaches I was thinking.&lt;/p&gt;

&lt;p&gt;Approach1.&lt;br/&gt;
Simply retry the insert transaction after some configured delay.&lt;/p&gt;

&lt;p&gt;Since we put a delay here for retry, by the time it gets rescheduled,&lt;br/&gt;
the locator delete event comes from device,&lt;br/&gt;
it gets cleared from operational data store.&lt;br/&gt;
As part of re-execution of event post the delay it sees that locator is not present and goes ahead and creates one.&lt;/p&gt;


&lt;p&gt;Approach2&lt;br/&gt;
Maintain a ref count on locator from config side.&lt;br/&gt;
When the ref count goes down to zero , put the locator in transit state.&lt;/p&gt;

&lt;p&gt;Now the insert of mac2 event comes.&lt;br/&gt;
It sees that its locator state is in transit.&lt;br/&gt;
When we see our dependency is in transit, it is pushed to dependency queue for all its dependencies to be resolved.&lt;/p&gt;

&lt;p&gt;If the device actually deletes the locator , then the locator is removed&lt;br/&gt;
from in transit state let us say with in the next 100ms or so.&lt;/p&gt;

&lt;p&gt;Then the event (insert mac2 ) which got pushed to queue gets executed since its dependency is resolved from in transit state.&lt;br/&gt;
As part of processing this event (insert mac2 ), it goes ahead and creates locator.&lt;/p&gt;


&lt;p&gt;If there is a bug in refcounting the locator references ( actually there are  references but we thought it is going to be deleted by looking at zero ref count and placed the locator in transit state ),&lt;/p&gt;

&lt;p&gt;then the device does not delete the locator&lt;/p&gt;

&lt;p&gt;The dependency queue event (insert mac2) ages out (expires) in 30secs (configured time) and proceeds with the original locator uuid to do insertion of mac.&lt;/p&gt;


&lt;p&gt;Also discussing the same on patch&lt;br/&gt;
&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/53594/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/53594/&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="41647" author="vishnoianil@gmail.com" created="Mon, 27 Mar 2017 18:24:16 +0000"  >&lt;p&gt;I am not very confident about the delay based approach, so the first approach looks bit risky and probably can introduce some race conditions etc. Second approach is probably the better approach. As per vtep schema, Physical Locator is referenced by Physical_Locator_Set,Ucast_Macs_Local and Ucast_Macs_Remote. It shows that Ucast_Macs_Local, Ucast_Macs_Remote both are having one to one mapping with physical locator, except Physical_Locator_Set. Physical_Locator_Set is something that is just holding the reference. Given that Ucast_Macs_Local, Ucast_Macs_Remote both has one to one mapping with Physical_Locator, i am wondering if we can club the create/delete of Physical_Locator with Ucast_Macs_Local, Ucast_Macs_Remote create/delete operations. So rather than relying on switch to automatically do that, let the controller explictly do it, that way the functional behavior of the plugin will be more deterministic.&lt;/p&gt;</comment>
                            <comment id="41648" author="k.v.suneelu.verma@ericsson.com" created="Tue, 28 Mar 2017 02:54:23 +0000"  >&lt;p&gt;Ucast mac controlling the creation and deletion of locator makes sense.&lt;/p&gt;

&lt;p&gt;Today One more variable in picture is tunnel. That is also creating the locator if it does not exist.&lt;/p&gt;

&lt;p&gt;So in the approach2 if we replace mcast mac1 and mcast mac2 as ucast mac1 and ucast mac2 , does it sound ok ?&lt;/p&gt;

&lt;p&gt;The only downside of this approach as i was talking is some times it causes unnecessary delays (upto precofigured delay 10-30sec) if the ref counting goes to zero ( if at all a bug is there in ref counting ).&lt;/p&gt;</comment>
                            <comment id="41649" author="k.v.suneelu.verma@ericsson.com" created="Tue, 4 Apr 2017 13:57:48 +0000"  >&lt;p&gt;I have made the changes to add ref count and verified using the suggested approach.&lt;br/&gt;
It works fine except for mcast macs.&lt;br/&gt;
After adding refcounts for locators referred by mcast macs along with ucast macs, it works fine.&lt;/p&gt;</comment>
                            <comment id="41650" author="k.v.suneelu.verma@ericsson.com" created="Tue, 5 Sep 2017 12:56:06 +0000"  >&lt;p&gt;review in progress&lt;br/&gt;
&lt;a href=&quot;https://git.opendaylight.org/gerrit/61535&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/61535&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8029</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=8029]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i022jb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>