<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 19:55:27 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>[CONTROLLER-1399] Clustering: DCN varies in normal and restart scenarios</title>
                <link>https://jira.opendaylight.org/browse/CONTROLLER-1399</link>
                <project id="10113" key="CONTROLLER">controller</project>
                    <description>&lt;p&gt;Test Environment : Single Node Controller&lt;/p&gt;

&lt;p&gt;For following case, DCN is received in normal operational condition and no DCN is received when the node gets restarted (ie. restoration is completed). &lt;/p&gt;

&lt;p&gt;Checked if the registration for DCN happened consistently during restart and registration seems to have no issues&lt;/p&gt;

&lt;p&gt;Normal Behavior	&lt;/p&gt;

&lt;p&gt;Path	        Scope 	Data Change	        DCN Received	        &lt;br/&gt;
========================================================================&lt;br/&gt;
/container/list	BASE	Add entry to list	On per entry basis	&lt;br/&gt;
/container/list	SUBTREE	Add entry to list	On per entry basis	&lt;/p&gt;


&lt;p&gt;Restart Behavior&lt;/p&gt;

&lt;p&gt;Path	        Scope 	Data Change	        DCN Received	        &lt;br/&gt;
========================================================================&lt;br/&gt;
/container/list	BASE	Add entry to list	No DCN event Received	&lt;br/&gt;
/container/list	SUBTREE	Add entry to list	No DCN event Received	&lt;/p&gt;


&lt;p&gt;When normal DCN behavior is different from restart behavior apps which act on DCN behave differently when nodal restart occurs&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="25953">CONTROLLER-1399</key>
            <summary>Clustering: DCN varies in normal and restart scenarios</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="tpantelis">Tom Pantelis</assignee>
                                    <reporter username="muthukumaran.k@ericsson.com">Muthukumaran Kothandaraman</reporter>
                        <labels>
                    </labels>
                <created>Wed, 5 Aug 2015 09:28:34 +0000</created>
                <updated>Mon, 14 Sep 2015 14:30:55 +0000</updated>
                            <resolved>Mon, 14 Sep 2015 14:30:55 +0000</resolved>
                                    <version>Lithium</version>
                                                    <component>clustering</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>12</watches>
                                                                                                                <comments>
                            <comment id="50943" author="muthukumaran.k@ericsson.com" created="Wed, 5 Aug 2015 09:31:59 +0000"  >&lt;p&gt;Please note that during restart, no entry is created newly in the mentioned path. Instead data is restored from persistent store. &lt;/p&gt;

&lt;p&gt;The expectation is that the DCN should fire consistently in normal and restart conditions provided path and scope of registration remains the same&lt;/p&gt;</comment>
                            <comment id="50961" author="deepthi.v.v@ericsson.com" created="Wed, 5 Aug 2015 18:27:07 +0000"  >&lt;p&gt;Attachment Controller restart test case and logs.txt has been added with description: Controller Restart Test Case, Log And Analysis&lt;/p&gt;</comment>
                            <comment id="50944" author="deepthi.v.v@ericsson.com" created="Wed, 12 Aug 2015 15:31:43 +0000"  >&lt;p&gt;The bug is valid even in normal operation condition, where the listener registers late for DCNs and before listener got registered, data is available in the datastore.&lt;/p&gt;</comment>
                            <comment id="50945" author="tony.tkacik@gmail.com" created="Tue, 18 Aug 2015 07:48:29 +0000"  >&lt;p&gt;Are you using DataChangeListener interface or DataTreeChangeListener interface?&lt;br/&gt;
Are you registering your listener using wildcards (not specifying keys?)&lt;/p&gt;</comment>
                            <comment id="50946" author="deepthi.v.v@ericsson.com" created="Tue, 18 Aug 2015 08:50:22 +0000"  >&lt;p&gt;Tony, we are using DataChangeListener interface.&lt;/p&gt;

&lt;p&gt;The listener registration is wildcard. The app is interested in all list entries.&lt;/p&gt;</comment>
                            <comment id="50947" author="muthukumaran.k@ericsson.com" created="Tue, 18 Aug 2015 10:30:43 +0000"  >&lt;p&gt;Hi Tony, &lt;/p&gt;

&lt;p&gt;Is firing DCNs during recovery of Config DS is a requirement irrespective of this bug ?&lt;/p&gt;

&lt;p&gt;This can introduce issues around scaling. For instance, when a specific subtree recovers a million entries and put back to Config DS, if DCNs are fired and apps take their own time executing their side-effects in DCNs, would that not cause unpredictable delays in recovery ?&lt;/p&gt;

&lt;p&gt;Regards&lt;br/&gt;
Muthu&lt;/p&gt;</comment>
                            <comment id="50948" author="muthukumaran.k@ericsson.com" created="Tue, 18 Aug 2015 15:04:28 +0000"  >&lt;p&gt;Hi Tony, &lt;/p&gt;

&lt;p&gt;Already clustered datastore is doing a deferred Listener registration after the recovery is completed. So, ideally, the notifications should not fire at all. &lt;/p&gt;

&lt;p&gt;As mentioned by Deepthi, we also tried late-registration - ie. populate datastore with few entries and then perform listener registration. In this case too we do not get notifications. &lt;/p&gt;

&lt;p&gt;So, essentially the question boils-down to the exact expected behavior during recovery so that apps do not follow usage patterns like &lt;br/&gt;
transact with Config DS -&amp;gt; get DCN -&amp;gt; transact with Operational DS.&lt;/p&gt;

&lt;p&gt;Such app patterns can lead to troubles during restart. &lt;/p&gt;

&lt;p&gt;Moreover, playing DCNs during recovery is actually a bad pattern.&lt;/p&gt;

&lt;p&gt;What are your thoughts ?&lt;/p&gt;</comment>
                            <comment id="50949" author="moraja@cisco.com" created="Tue, 25 Aug 2015 19:26:44 +0000"  >&lt;p&gt;        final Optional&amp;lt;NormalizedNode&amp;lt;?, ?&amp;gt;&amp;gt; currentState = dataTree.takeSnapshot().readNode(path);&lt;br/&gt;
        final DOMImmutableDataChangeEvent event;&lt;br/&gt;
        if (currentState.isPresent()) &lt;/p&gt;
{
            final NormalizedNode&amp;lt;?, ?&amp;gt; data = currentState.get();
            event = DOMImmutableDataChangeEvent.builder(DataChangeScope.BASE).setAfter(data).addCreated(path, data).build();
        }
&lt;p&gt; else &lt;/p&gt;
{
            event = null;
        }

&lt;p&gt;This is what we do when a dcn is registered in CDS. Notice that when we create the initial event we specify the scope as BASE. I am wondering if when this event is processed by the DataBroker it fails to match the event with the binding aware listeners and thus no event is generated on the binding side. I still need to confirm this but I suspect this may be the root cause.&lt;/p&gt;</comment>
                            <comment id="50950" author="vishnoianil@gmail.com" created="Tue, 25 Aug 2015 19:36:26 +0000"  >&lt;p&gt;In my scenario, i register listener with the data change scope of SUBTREE. I can give it a quick try by changing the scope to BASE and see if it works.&lt;/p&gt;</comment>
                            <comment id="50951" author="vishnoianil@gmail.com" created="Tue, 25 Aug 2015 20:50:06 +0000"  >&lt;p&gt;I changes the data change scope from SUBTREE to BASE for the listener registration, but no change in the behavior. I also tried with data change scope ONE and same results, No change.&lt;/p&gt;</comment>
                            <comment id="50952" author="tpantelis" created="Wed, 26 Aug 2015 19:52:57 +0000"  >&lt;p&gt;As I tested, I mimiced Anil&apos;s OVSDB registration by adding a &quot;passenger&quot; list to the car test model. The registration is:&lt;/p&gt;

&lt;p&gt;InstanceIdentifier&amp;lt;Passenger&amp;gt; path = InstanceIdentifier&lt;br/&gt;
    .create(Cars.class)&lt;br/&gt;
    .child(CarEntry.class, new CarEntryKey(new CarId(&quot;car1&quot;)))&lt;br/&gt;
    .child(Passenger.class);&lt;/p&gt;

&lt;p&gt;getDataBrokerDependency().registerDataChangeListener(&lt;br/&gt;
    LogicalDatastoreType.CONFIGURATION, path, new CarListener(),&lt;br/&gt;
    DataChangeScope.SUBTREE);&lt;/p&gt;

&lt;p&gt;So the last argument is wildcarded for the Passenger list.&lt;/p&gt;

&lt;p&gt;When I create a car with a passenger the listener gets notified as expected. But on restart it doesn&apos;t. The problem is that the read call:&lt;/p&gt;

&lt;p&gt;  Optional&amp;lt;NormalizedNode&amp;lt;?, ?&amp;gt;&amp;gt; currentState =                      &lt;br/&gt;
                               dataTree.takeSnapshot().readNode(path);&lt;/p&gt;

&lt;p&gt;returns absent. &lt;/p&gt;

&lt;p&gt;The DOM path is &lt;/p&gt;

&lt;p&gt;   /(urn:sal-clustering-it:car?revision=2014-08-18)cars/car-entry&lt;br/&gt;
     /car-entry[&lt;/p&gt;
{(urn:sal-clustering-it:car?revision=2014-08-18)id=car1}
&lt;p&gt;]&lt;br/&gt;
     /passenger/passenger&lt;/p&gt;

&lt;p&gt;The first path arg corresponds to the MapNode in the tree and the second represents the wildcarded MapNodeEntry instances. As NormalizedNodes.findNode traverses the path args, when it hits the last path arg, NormalizedNodes.getDirectChild expects a key path arg of type NodeIdentifierWithPredicates for a parent MapNode:&lt;/p&gt;

&lt;p&gt;  else if (node instanceof MapNode &amp;amp;&amp;amp; pathArg instanceof &lt;br/&gt;
                                            NodeIdentifierWithPredicates) {&lt;br/&gt;
            return (Optional) ((MapNode) node)&lt;br/&gt;
                      .getChild((NodeIdentifierWithPredicates) pathArg);&lt;/p&gt;

&lt;p&gt;However the actual path arg is NodeIdentifier because it&apos;s wildcarded.&lt;/p&gt;

&lt;p&gt;It seems the solution is to add a case for &quot;node instanceof MapNode &amp;amp;&amp;amp; pathArg instanceof NodeIdentifier&quot; to return the MapNode.&lt;/p&gt;</comment>
                            <comment id="50953" author="tpantelis" created="Wed, 26 Aug 2015 19:54:59 +0000"  >&lt;p&gt;In the comments below, I meant to say &quot;The first &quot;passenger&quot; path arg corresponds to the MapNode ...&quot;&lt;/p&gt;

&lt;p&gt;(In reply to Tom Pantelis from comment #11)&lt;br/&gt;
&amp;gt; As I tested, I mimiced Anil&apos;s OVSDB registration by adding a &quot;passenger&quot;&lt;br/&gt;
&amp;gt; list to the car test model. The registration is:&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; InstanceIdentifier&amp;lt;Passenger&amp;gt; path = InstanceIdentifier&lt;br/&gt;
&amp;gt;     .create(Cars.class)&lt;br/&gt;
&amp;gt;     .child(CarEntry.class, new CarEntryKey(new CarId(&quot;car1&quot;)))&lt;br/&gt;
&amp;gt;     .child(Passenger.class);&lt;br/&gt;
&amp;gt;       &lt;br/&gt;
&amp;gt; getDataBrokerDependency().registerDataChangeListener(&lt;br/&gt;
&amp;gt;     LogicalDatastoreType.CONFIGURATION, path, new CarListener(),&lt;br/&gt;
&amp;gt;     DataChangeScope.SUBTREE);&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; So the last argument is wildcarded for the Passenger list.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; When I create a car with a passenger the listener gets notified as expected.&lt;br/&gt;
&amp;gt; But on restart it doesn&apos;t. The problem is that the read call:&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt;   Optional&amp;lt;NormalizedNode&amp;lt;?, ?&amp;gt;&amp;gt; currentState =                      &lt;br/&gt;
&amp;gt;                                dataTree.takeSnapshot().readNode(path);&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; returns absent. &lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; The DOM path is &lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt;    /(urn:sal-clustering-it:car?revision=2014-08-18)cars/car-entry&lt;br/&gt;
&amp;gt;      /car-entry[&lt;/p&gt;
{(urn:sal-clustering-it:car?revision=2014-08-18)id=car1}
&lt;p&gt;]&lt;br/&gt;
&amp;gt;      /passenger/passenger&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; The first path arg corresponds to the MapNode in the tree and the second&lt;br/&gt;
&amp;gt; represents the wildcarded MapNodeEntry instances. As&lt;br/&gt;
&amp;gt; NormalizedNodes.findNode traverses the path args, when it hits the last path&lt;br/&gt;
&amp;gt; arg, NormalizedNodes.getDirectChild expects a key path arg of type&lt;br/&gt;
&amp;gt; NodeIdentifierWithPredicates for a parent MapNode:&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt;   else if (node instanceof MapNode &amp;amp;&amp;amp; pathArg instanceof &lt;br/&gt;
&amp;gt;                                             NodeIdentifierWithPredicates) {&lt;br/&gt;
&amp;gt;             return (Optional) ((MapNode) node)&lt;br/&gt;
&amp;gt;                       .getChild((NodeIdentifierWithPredicates) pathArg);&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; However the actual path arg is NodeIdentifier because it&apos;s wildcarded.&lt;br/&gt;
&amp;gt; &lt;br/&gt;
&amp;gt; It seems the solution is to add a case for &quot;node instanceof MapNode &amp;amp;&amp;amp;&lt;br/&gt;
&amp;gt; pathArg instanceof NodeIdentifier&quot; to return the MapNode.&lt;/p&gt;</comment>
                            <comment id="50954" author="tpantelis" created="Wed, 26 Aug 2015 20:43:18 +0000"  >&lt;p&gt;Adding the case as I mentioned previously might easily work if the wildcarded path arg is at the end but would be trickier if in the middle.&lt;/p&gt;

&lt;p&gt;The binding read interface does not allow wildcarded reads - I tried reading the same path as was used to register and it throw an IllegalArgumentEx. So naturally neither does the DOM API, although it returns absent instead of throwing an ex.&lt;/p&gt;

&lt;p&gt;Maybe the solution is to read the root and let the ResolveDataChangeEventsTask code sort it out. This may be expensive but we could offload it to the listener actor. &lt;/p&gt;

&lt;p&gt;Tony - what do you think?&lt;/p&gt;</comment>
                            <comment id="50955" author="tony.tkacik@gmail.com" created="Thu, 27 Aug 2015 13:15:38 +0000"  >&lt;p&gt;I would not read root, but rather up to first wildcard and then let ResolveDataChangeEvent to resolve this.&lt;/p&gt;</comment>
                            <comment id="50956" author="tpantelis" created="Thu, 27 Aug 2015 17:58:12 +0000"  >&lt;p&gt;Will do.&lt;/p&gt;

&lt;p&gt;(In reply to Tony Tkacik from comment #14)&lt;br/&gt;
&amp;gt; I would not read root, but rather up to first wildcard and then let&lt;br/&gt;
&amp;gt; ResolveDataChangeEvent to resolve this.&lt;/p&gt;</comment>
                            <comment id="50957" author="tpantelis" created="Thu, 10 Sep 2015 03:34:45 +0000"  >&lt;p&gt;stable/lithium patch &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/26548/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/26548/&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="50958" author="vishnoianil@gmail.com" created="Mon, 14 Sep 2015 12:38:52 +0000"  >&lt;p&gt;testing the fix..&lt;/p&gt;</comment>
                            <comment id="50959" author="vishnoianil@gmail.com" created="Mon, 14 Sep 2015 14:29:53 +0000"  >&lt;p&gt;I tested the above patch and it works fine. I can see the Data Change blob when i restart the controller.&lt;/p&gt;</comment>
                            <comment id="50960" author="vishnoianil@gmail.com" created="Mon, 14 Sep 2015 14:30:55 +0000"  >&lt;p&gt;I changed the state to Verified/Fixed, let me know if i need to change it back to Resolved/Fixed.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10002">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="25964">CONTROLLER-1410</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="13534" name="Controller restart test case and logs.txt" size="15710" author="deepthi.v.v@ericsson.com" created="Wed, 5 Aug 2015 18:27:07 +0000"/>
                    </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>4094</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=4094]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10206" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Issue Type</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10300"><![CDATA[Bug]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10204" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>ODL SR Target Milestone</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10315"><![CDATA[Lithium]]></customfieldvalue>

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

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