<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 19:53:43 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-726] Issues with using container and default values in config yang</title>
                <link>https://jira.opendaylight.org/browse/CONTROLLER-726</link>
                <project id="10113" key="CONTROLLER">controller</project>
                    <description>&lt;p&gt;In the distributed datastore, the operational and config data stores are separate modules but have the same configuration data. Instead of duplicating the config definitions I created a grouping to contain them, i.e.&lt;/p&gt;

&lt;p&gt;    grouping data-store-properties {&lt;br/&gt;
        leaf max-shard-data-change-executor-queue-size &lt;/p&gt;
{
            default 1000;
            type uint16;
            description &quot;...&quot;;
         }
&lt;p&gt;         ...&lt;br/&gt;
         leaf max-shard-data-change-executor-pool-size &lt;/p&gt;
{
            default 20;
            type uint16;
         }
&lt;p&gt;     }&lt;/p&gt;

&lt;p&gt;     augment &quot;/config:modules/config:module/config:configuration&quot; {&lt;br/&gt;
         // operation data store&lt;br/&gt;
         ...&lt;br/&gt;
         container operational-properties &lt;/p&gt;
{
             uses data-store-properties;
         }&lt;br/&gt;
     }&lt;br/&gt;
&lt;br/&gt;
     augment &quot;/config:modules/config:module/config:configuration&quot; {&lt;br/&gt;
         // configuration data store&lt;br/&gt;
         ...&lt;br/&gt;
         container config-properties {             uses data-store-properties;         }
&lt;p&gt;     }&lt;/p&gt;

&lt;p&gt;In the initial config XML I didn&apos;t specify anything for operational-properties. This resulted in an exception emanating from CompositeAttributeResolvingStrategy#parseAttribute from this line:&lt;/p&gt;

&lt;p&gt;   Util.checkType(value, Map.class);&lt;/p&gt;

&lt;p&gt;The error occurred for &quot;operational-properties&quot; when trying to get the default value (which should be null). The &apos;value&apos; instance was a String with value &quot;20&quot; but the code expects a Map instance.&lt;/p&gt;

&lt;p&gt;After debugging I tracked the bug to ObjectXmlReader#caseTOAttribute. This code runs for the &quot;operational-properties&quot; container and obtains the default value from the instance returned from getLastAttribute() which is set by the base class prior to calling caseTOAttribute. Prior to this, caseTOAttribute loops through and processes the entries for the inner leafs. However, these entries result in calls back into the base class which changes the instance returned from getLastAttribute(). So &quot;operational-properties&quot; ends up getting the default value for the last inner leaf (&quot;20&quot; in this case).&lt;/p&gt;

&lt;p&gt;I was able to fix this by retrieving and storing getLastAttribute() in a local var at the beginning of ObjectXmlReader#caseTOAttribute. I also did the same for a couple other methods that could suffer the same issue. The use of getLastAttribute() seems fragile - this should probably get passed into the methods but that would require some refactoring.&lt;/p&gt;

&lt;p&gt;I then ran into another problem with specifying partial config params in the XML. Eg, with this XML:&lt;/p&gt;

&lt;p&gt;  &amp;lt;operational-properties&amp;gt;&lt;br/&gt;
    &amp;lt;max-shard-data-change-executor-queue-size&amp;gt;500&amp;lt;/max-shard-data-change-executor-queue-size &amp;gt;&lt;br/&gt;
  &amp;lt;/operational-properties&amp;gt;&lt;/p&gt;

&lt;p&gt;From the resulting OperationalProperties instance that&apos;s injected into the Module, I got the expected value of 500 from getMaxShardDataChangeExecutorQueueSize(). However getMaxShardDataChangeExecutorPoolSize() returned null - I should have gotten the default value 20.&lt;/p&gt;

&lt;p&gt;This required a change in CompositeAttributeReadingStrategy#readElementHook to take the default value of the inner leaf if its XML value isn&apos;t specified.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="25280">CONTROLLER-726</key>
            <summary>Issues with using container and default values in config yang</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="tpantelis">Tom Pantelis</assignee>
                                    <reporter username="tpantelis">Tom Pantelis</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Aug 2014 02:57:20 +0000</created>
                <updated>Wed, 27 Aug 2014 18:21:48 +0000</updated>
                            <resolved>Wed, 27 Aug 2014 18:21:48 +0000</resolved>
                                    <version>Helium</version>
                                                    <component>config</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="48959" author="tpantelis" created="Tue, 26 Aug 2014 03:01:00 +0000"  >&lt;p&gt;Submitted &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/10272/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/10272/&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>1616</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=1616]]></customfieldvalue>

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

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