[NETCONF-1153] Unnecessary data change events for child-nodes-only Created: 08/Sep/23  Updated: 19/Sep/23  Resolved: 19/Sep/23

Status: Resolved
Project: netconf
Component/s: restconf-nb
Affects Version/s: 6.0.3
Fix Version/s: 7.0.0, 6.0.4

Type: Bug Priority: Medium
Reporter: Sangwook Ha Assignee: Sangwook Ha
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to NETCONF-1076 Add Child only mode to SSE / Websocket Resolved

 Description   

When subscribing data change notification with the child-nodes-only mode, the notification includes unnecessary data change events for the list key nodes in the data path.

For example, when the keepalive-delay value of a NETCONF node is updated with the following PUT request

PUT /rests/data/network-topology:network-topology/topology=topology-netconf/node=netconf-mdsal1/netconf-node-topology:keepalive-delay

{
    "netconf-node-topology:keepalive-delay": 180
}

A notification message like this is generated:

{
  "urn-ietf-params-xml-ns-netconf-notification-1.0:notification": {
    "event-time": "2023-09-08T18:12:43.16825253Z",
    "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification": {
      "data-change-event": [
        {
          "path": "/urn-TBD-params-xml-ns-yang-network-topology:network-topology/urn-TBD-params-xml-ns-yang-network-topology:topology/urn-TBD-params-xml-ns-yang-network-topology:topology[urn-TBD-params-xml-ns-yang-network-topology:topology-id='topology-netconf']/urn-TBD-params-xml-ns-yang-network-topology:topology-id",
          "data": {
            "network-topology:topology-id": "topology-netconf"
          },
          "operation": "updated"
        },
        {
          "path": "/urn-TBD-params-xml-ns-yang-network-topology:network-topology/urn-TBD-params-xml-ns-yang-network-topology:topology/urn-TBD-params-xml-ns-yang-network-topology:topology[urn-TBD-params-xml-ns-yang-network-topology:topology-id='topology-netconf']/urn-TBD-params-xml-ns-yang-network-topology:node/urn-TBD-params-xml-ns-yang-network-topology:node[urn-TBD-params-xml-ns-yang-network-topology:node-id='netconf-mdsal1']/urn-opendaylight-netconf-node-topology:keepalive-delay",
          "data": {
            "netconf-node-topology:keepalive-delay": 180
          },
          "operation": "updated"
        },
        {
          "path": "/urn-TBD-params-xml-ns-yang-network-topology:network-topology/urn-TBD-params-xml-ns-yang-network-topology:topology/urn-TBD-params-xml-ns-yang-network-topology:topology[urn-TBD-params-xml-ns-yang-network-topology:topology-id='topology-netconf']/urn-TBD-params-xml-ns-yang-network-topology:node/urn-TBD-params-xml-ns-yang-network-topology:node[urn-TBD-params-xml-ns-yang-network-topology:node-id='netconf-mdsal1']/urn-TBD-params-xml-ns-yang-network-topology:node-id",
          "data": {
            "network-topology:node-id": "netconf-mdsal1"
          },
          "operation": "updated"
        }
      ]
    }
  }
}

Note that there are data change events for topology-id & node-id, which are the key nodes of topology & node, respectively, in addition to keepalive-delay.

This is quite confusing and makes it harder to understand what has changed.



 Comments   
Comment by Sangwook Ha [ 09/Sep/23 ]

The way child-nodes-only mode works is interesting because data-change-event depends on how the data tree is updated or what is stored in the data tree.
For example, updating a leaf node may generate a data-change-event for its parent container/list entry (e.g. updated with a PUT request targeting its parent node) or for the leaf node (e.g. updated with a PUT request targeting the leaf node). Removing a list entry may generate a data-change-event for the list entry (if there is any other list entry) or for its parent container/list (if the removed list entry is the only one in the list, hence the list itself is removed and maybe even its parents).

Generated at Wed Feb 07 20:16:48 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.