<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 19:52:12 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-109] Read of stored data with augmentation, from operational datastore does not return augmentations</title>
                <link>https://jira.opendaylight.org/browse/CONTROLLER-109</link>
                <project id="10113" key="CONTROLLER">controller</project>
                    <description>&lt;p&gt;If we insert a NodeConnector object with FlowCapableNode augmentation into operational datastore and read the same data using the same instance identifier, data retrieved does not contain augmentation.&lt;/p&gt;

&lt;p&gt;Steps to reproduce the issue:&lt;br/&gt;
1. Create a NodeConnector object and attach a FlowCapableNode augmentation to it.&lt;br/&gt;
2. Add and commit this data to operational datastore using InstanceIdentifier:&lt;br/&gt;
   InstanceIdentifier.builder(Nodes.class).child(Node.class, nodeKey).child(NodeConnector.class, nodeConnectorKey).toInstance();&lt;/p&gt;

&lt;p&gt;3. After the commit is successful, read the data from the operational datastore using instance identifier: InstanceIdentifier.builder(Nodes.class).child(Node.class, nodeKey).child(NodeConnector.class, nodeConnectorKey).augmentation(FlowCapableNodeConnector.class).toInstance();&lt;/p&gt;

&lt;p&gt;The data read will be null. If same instance identifier specified in step 2 is used, we will receive all data except for the augmentation.&lt;/p&gt;

&lt;p&gt;4. If we read the data through restconf, the data persisted is received correctly:&lt;br/&gt;
Eg: &lt;a href=&quot;http://localhost:8080/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/node-connector/openflow:1:1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8080/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/node-connector/openflow:1:1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I used the following code:&lt;br/&gt;
    public void _readMDPort(CommandInterpreter ci) {&lt;br/&gt;
      Integer dpId = Integer.parseInt(ci.nextArgument());&lt;br/&gt;
      Integer portno = Integer.parseInt(ci.nextArgument());&lt;/p&gt;

&lt;p&gt;      String nodeIdValue = &quot;openflow:&quot; + dpId;&lt;br/&gt;
      NodeId nodeId = new NodeId(nodeIdValue);&lt;br/&gt;
      NodeKey nodeKey = new NodeKey(nodeId);&lt;/p&gt;

&lt;p&gt;      String nodeConnectorIdValue = nodeIdValue + &quot;:&quot; + portno;&lt;br/&gt;
      NodeConnectorId nodeConnectorId = new NodeConnectorId(nodeConnectorIdValue);&lt;br/&gt;
      NodeConnectorKey nodeConnectorKey = new NodeConnectorKey(nodeConnectorId);&lt;/p&gt;

&lt;p&gt;      NodeConnectorBuilder data = new NodeConnectorBuilder();&lt;br/&gt;
      data.setId(nodeConnectorId);&lt;br/&gt;
      data.setKey(nodeConnectorKey);&lt;br/&gt;
      FlowCapableNodeConnector augment = loadPortData();&lt;br/&gt;
      data.addAugmentation(FlowCapableNodeConnector.class, augment);&lt;/p&gt;

&lt;p&gt;      InstanceIdentifier&amp;lt;NodeConnector&amp;gt; ncIdentifierWriter =&lt;br/&gt;
          InstanceIdentifier.builder(Nodes.class).child(Node.class, nodeKey)&lt;br/&gt;
              .child(NodeConnector.class, nodeConnectorKey).toInstance();&lt;br/&gt;
      DataModification&amp;lt;InstanceIdentifier&amp;lt;?&amp;gt;, DataObject&amp;gt; modification =&lt;br/&gt;
          dataBrokerService.beginTransaction();&lt;br/&gt;
      modification.putOperationalData(ncIdentifierWriter, data.build());&lt;br/&gt;
      Future&amp;lt;RpcResult&amp;lt;TransactionStatus&amp;gt;&amp;gt; commitFuture = modification.commit();&lt;br/&gt;
      try&lt;/p&gt;
      {
        RpcResult&amp;lt;TransactionStatus&amp;gt; result = commitFuture.get();
        TransactionStatus status = result.getResult();
        ci.println(&quot;Status of Port Data Loaded Transaction: &quot; + status);
      }
&lt;p&gt;      catch (InterruptedException e)&lt;/p&gt;
      {
        LOG.error(e.getMessage(), e);
      }&lt;br/&gt;
      catch (ExecutionException e)&lt;br/&gt;
      {        LOG.error(e.getMessage(), e);      }

&lt;p&gt;      InstanceIdentifier&amp;lt;FlowCapableNodeConnector&amp;gt; ncIdentifierReader =&lt;br/&gt;
          InstanceIdentifier.builder(Nodes.class).child(Node.class, nodeKey)&lt;br/&gt;
              .child(NodeConnector.class, nodeConnectorKey)&lt;br/&gt;
              .augmentation(FlowCapableNodeConnector.class).toInstance();&lt;br/&gt;
      FlowCapableNodeConnector port = (FlowCapableNodeConnector) dataBrokerService&lt;br/&gt;
              .readOperationalData(ncIdentifierReader);&lt;br/&gt;
      if (port != null)&lt;/p&gt;
      {
        System.out.println(&quot;Read Port : &quot; + port);
      }
&lt;p&gt;    }&lt;/p&gt;

&lt;p&gt;  private static FlowCapableNodeConnector loadPortData() &lt;/p&gt;
{
    final FlowCapableNodeConnectorBuilder flowCapableNodeConnectorBuilder = new FlowCapableNodeConnectorBuilder();
    PortFeatures _advertisedFeatures = PortFeatures.getDefaultInstance(&quot;_100mbFd&quot;);
    flowCapableNodeConnectorBuilder.setAdvertisedFeatures(_advertisedFeatures);
    PortConfig _configuration = PortConfig.getDefaultInstance(&quot;nOPACKETIN&quot;);
    flowCapableNodeConnectorBuilder.setConfiguration(_configuration);
    PortFeatures _currentFeature = PortFeatures.getDefaultInstance(&quot;_100mbFd&quot;);
    flowCapableNodeConnectorBuilder.setCurrentFeature(_currentFeature);
    Long _currentSpeed = 1L;
    flowCapableNodeConnectorBuilder.setCurrentSpeed(_currentSpeed);
    MacAddress _hardwareAddress = new MacAddress(&quot;11:12:13:14:15:16&quot;);
    flowCapableNodeConnectorBuilder.setHardwareAddress(_hardwareAddress);
    Long _maximumSpeed = 1L;
    flowCapableNodeConnectorBuilder.setMaximumSpeed(_maximumSpeed);
    String _name = &quot;test&quot;;
    flowCapableNodeConnectorBuilder.setName(_name);
    PortFeatures _peerFeatures = PortFeatures.getDefaultInstance(&quot;_100mbFd&quot;);
    flowCapableNodeConnectorBuilder.setPeerFeatures(_peerFeatures);
    Long _portNumber = 1L;
    flowCapableNodeConnectorBuilder.setPortNumber(_portNumber);
    PortState _state = PortState.forValue(0);
    flowCapableNodeConnectorBuilder.setState(_state);
    PortFeatures _supported = PortFeatures.getDefaultInstance(&quot;_100mbFd&quot;);
    flowCapableNodeConnectorBuilder.setSupported(_supported);
    return flowCapableNodeConnectorBuilder.build();
  }


&lt;p&gt;Some observations:&lt;br/&gt;
1. InstanceIdentifier path elements does not have Qname associated with them when used directly through code where as the InstanceIdentifier generated from RestconfImpl class generates path elements with Qname containing module name, revision.&lt;br/&gt;
2. Same issue was observed using Node and FlowCapableNode.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: Windows&lt;br/&gt;
Platform: PC&lt;/p&gt;</environment>
        <key id="24663">CONTROLLER-109</key>
            <summary>Read of stored data with augmentation, from operational datastore does not return augmentations</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="deepthi.v.v@ericsson.com">Deepthi V V</reporter>
                        <labels>
                    </labels>
                <created>Fri, 3 Jan 2014 13:41:58 +0000</created>
                <updated>Tue, 25 Jul 2023 08:22:58 +0000</updated>
                            <resolved>Tue, 14 Jan 2014 12:17:44 +0000</resolved>
                                                                    <component>mdsal</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                        <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>267</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=267]]></customfieldvalue>

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

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