<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 19:53:23 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-581] DataChangeListener unable to read created data</title>
                <link>https://jira.opendaylight.org/browse/CONTROLLER-581</link>
                <project id="10113" key="CONTROLLER">controller</project>
                    <description>&lt;p&gt;In application DataChangeListener is registered.&lt;/p&gt;

&lt;p&gt;Upon sending POST using restconf onDataChanged method is invoked.&lt;/p&gt;

&lt;p&gt;Following code:&lt;br/&gt;
public void onDataChanged(DataChangeEvent&amp;lt;InstanceIdentifier&amp;lt;?&amp;gt;, DataObject&amp;gt; change) {&lt;br/&gt;
    logger.info(&quot;onDataChanged change.getCreatedOperationalData().entrySet().size()={}&quot;,&lt;br/&gt;
                change.getCreatedOperationalData().entrySet().size());&lt;br/&gt;
    logger.info(&quot;onDataChanged change.getUpdatedOperationalData().entrySet().size()={}&quot;,&lt;br/&gt;
                change.getUpdatedOperationalData().entrySet().size());&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;Produces output:&lt;br/&gt;
2014-06-24 14:56:48.995 CEST &lt;span class=&quot;error&quot;&gt;&amp;#91;pool-14-thread-2&amp;#93;&lt;/span&gt; INFO  o.o.c.i.d.a.i.h.ServiceElineListener - onDataChanged change.getCreatedOperationalData().entrySet().size()=0&lt;br/&gt;
2014-06-24 14:56:48.997 CEST &lt;span class=&quot;error&quot;&gt;&amp;#91;pool-14-thread-2&amp;#93;&lt;/span&gt; INFO  o.o.c.i.d.a.i.h.ServiceElineListener - onDataChanged change.getUpdatedOperationalData().entrySet().size()=0&lt;/p&gt;

&lt;p&gt;Subsequent GET on restconf proves POST-ed data are stored into datastore.&lt;/p&gt;

&lt;p&gt;Since DataCommitHandler has bug registered, this second approach to read created data, is blocker for us.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: Windows&lt;br/&gt;
Platform: PC&lt;/p&gt;</environment>
        <key id="25135">CONTROLLER-581</key>
            <summary>DataChangeListener unable to read created data</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                                <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="rgallas@cisco.com">Robert Gallas</reporter>
                        <labels>
                    </labels>
                <created>Tue, 24 Jun 2014 13:08:58 +0000</created>
                <updated>Tue, 25 Jul 2023 08:23:56 +0000</updated>
                            <resolved>Wed, 25 Jun 2014 10:47:14 +0000</resolved>
                                                                    <component>mdsal</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="48588" author="tony.tkacik@gmail.com" created="Tue, 24 Jun 2014 14:38:55 +0000"  >&lt;p&gt;You are reading from Operational DAta but you are posting to configuration&lt;br/&gt;
data tree. Please update your code&lt;br/&gt;
to change.getCreatedConfigurationData() and change.getUpdatedConfigurationData().&lt;/p&gt;

&lt;p&gt;Operational data CAN NOT be updated via Restconf, that is why you see&lt;br/&gt;
this fields empty.&lt;/p&gt;

&lt;p&gt;Marked this as Resolved - Invalid, since Data Change Listeners (using &lt;b&gt;Configuration&lt;/b&gt;) methods are verified to be working with Restconf.&lt;/p&gt;

&lt;p&gt;(&lt;a href=&quot;https://jenkins.opendaylight.org/integration/job/integration-master-csit-base-of13/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://jenkins.opendaylight.org/integration/job/integration-master-csit-base-of13/&lt;/a&gt; - test restconf puts, components process data as data changes).&lt;/p&gt;</comment>
                            <comment id="48589" author="rgallas@cisco.com" created="Wed, 25 Jun 2014 07:14:22 +0000"  >&lt;p&gt;Sorry may fault: &lt;br/&gt;
Of course reading configuration data an not operational data is what fails:&lt;/p&gt;

&lt;p&gt;        logger.info(&quot;onDataChanged change.getCreatedConfigurationData().entrySet().size()={}&quot;,&lt;br/&gt;
                change.getCreatedConfigurationData().entrySet().size());&lt;br/&gt;
        logger.info(&quot;onDataChanged change.getUpdatedConfigurationData().entrySet().size()={}&quot;,&lt;br/&gt;
                change.getUpdatedConfigurationData().entrySet().size());&lt;/p&gt;


&lt;p&gt;ends up with:&lt;br/&gt;
2014-06-25 08:49:09.190 CEST &lt;span class=&quot;error&quot;&gt;&amp;#91;pool-15-thread-2&amp;#93;&lt;/span&gt; INFO  o.o.c.i.d.a.i.h.ServiceXXXListener - onDataChanged change.getCreatedConfigurationData().entrySet().size()=0&lt;br/&gt;
2014-06-25 08:49:09.191 CEST &lt;span class=&quot;error&quot;&gt;&amp;#91;pool-15-thread-2&amp;#93;&lt;/span&gt; INFO  o.o.c.i.d.a.i.h.ServiceXXXListener - onDataChanged change.getUpdatedConfigurationData().entrySet().size()=0&lt;/p&gt;

&lt;p&gt;As I said in bug creation data are inserted in data store but deserialization fails at data change listener.&lt;/p&gt;

&lt;p&gt;Hovever there is a difference in output: when logger contains code to read configuration data exception is thorwn:&lt;/p&gt;

&lt;p&gt;So the steps are:&lt;br/&gt;
1. init application&lt;br/&gt;
2. send restconf post with data&lt;br/&gt;
   Async listener events:&lt;br/&gt;
       if change.getCreatedConfigurationData().entrySet() is called, entry set equalls zero and deserialization exception is thrown&lt;br/&gt;
       if change.getCreatedOperationalData().entrySet() is called entry set equalls to zero (which is correct) but not exception is thrown.&lt;br/&gt;
3. successful return from restconf post&lt;br/&gt;
4. restconf get confirms data are uploaded to store&lt;/p&gt;

&lt;p&gt;Root cause of exception seems to be:&lt;br/&gt;
Caused by: java.lang.ClassNotFoundException: org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress&lt;/p&gt;

&lt;p&gt;Meaning that even data are succesfully uploaded to datastore&lt;/p&gt;

&lt;p&gt;1. in listener I&apos;m unable to read change&lt;br/&gt;
2. exception is thrown based on reading config or operational data because of ClassNotFoundException, but missing class does not prevents data to be stored in datastore&lt;br/&gt;
3. fails to read (deserialize) but not to store data in data store. Seems like dual approach in handling datastore operations. (guess only of course)&lt;/p&gt;

&lt;p&gt;Code is proprietary so I cannot post code. So only code samples&lt;/p&gt;

&lt;p&gt;Referencig yang:&lt;/p&gt;

&lt;p&gt;...&lt;br/&gt;
import ietf-yang-types &lt;/p&gt;
{ prefix &quot;yang&quot;; }
&lt;p&gt;...&lt;br/&gt;
leaf mac-address {&lt;br/&gt;
     type yang:mac-address;&lt;br/&gt;
     ...&lt;br/&gt;
}&lt;br/&gt;
...&lt;/p&gt;

&lt;p&gt;In cache there are two ietf-yang-types and both of them contains:&lt;br/&gt;
...&lt;br/&gt;
typedef mac-address {&lt;br/&gt;
    type string {&lt;br/&gt;
      pattern &apos;&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9a-fA-F&amp;#93;&lt;/span&gt;&lt;/p&gt;
{2}(:&lt;span class=&quot;error&quot;&gt;&amp;#91;0-9a-fA-F&amp;#93;&lt;/span&gt;{2}
&lt;p&gt;)&lt;/p&gt;
{5}
&lt;p&gt;&apos;;&lt;br/&gt;
    } &lt;br/&gt;
...&lt;/p&gt;</comment>
                            <comment id="48590" author="rgallas@cisco.com" created="Wed, 25 Jun 2014 10:47:14 +0000"  >&lt;p&gt;referencing YANG needes to reference ietf-yang-types by revision as well. After adding revision listener works OK.&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>1240</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=1240]]></customfieldvalue>

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

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