[CONTROLLER-1409] Listening on root node does not work in registerDataChangeListener Created: 21/Aug/15  Updated: 19/Oct/17  Resolved: 24/Aug/17

Status: Resolved
Project: controller
Component/s: clustering
Affects Version/s: Beryllium
Fix Version/s: None

Type: Bug
Reporter: Jakub Morvay Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Blocks
blocks NETCONF-33 Milestone: Add support for netconf no... Resolved
External issue ID: 4167

 Description   

If I register a listener like this

domDataBroker.registerDataChangeListener(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.builder().build(), new myDOMDataChangeListener(), AsyncDataBroker.DataChangeScope.SUBTREE);

I get exception java.util.NoSuchElementException
at com.google.common.collect.Iterators$1.next(Iterators.java:80)
at org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategyFactory.getModuleName(ShardStrategyFactory.java:47)
at org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategyFactory.getStrategy(ShardStrategyFactory.java:36)
at org.opendaylight.controller.cluster.datastore.DistributedDataStore.registerChangeListener(DistributedDataStore.java:128)
at org.opendaylight.controller.cluster.databroker.AbstractDOMBroker.registerDataChangeListener(AbstractDOMBroker.java:98)
at org.opendaylight.controller.cluster.databroker.AbstractDOMBroker.registerDataChangeListener(AbstractDOMBroker.java:34)
at org.opendaylight.controller.config.yang.netconf.mdsal.notification.NetconfMdsalNotificationMapperModule.createInstance(NetconfMdsalNotificationMapperModule.java:46)



 Comments   
Comment by Moiz Raja [ 01/Sep/15 ]

Jakub what is the use case for this?

Comment by Robert Varga [ 15/Jul/16 ]

The use case for this BUG-1045, which needs to collect all changes happening in the data store. This works just fine with IMDS, but the CDS implementation fails here, simply because it cannot determine the single shard for the listener.

The implementation should instantiate listeners for each shard in existence and combine the results to provide a seamless experience.

Comment by Robert Varga [ 15/Jul/16 ]

https://git.opendaylight.org/gerrit/41887

Comment by Robert Varga [ 03/Aug/16 ]

The fix merged does not completely solve the problem, as it does not work across shards (e.g. it does not report data in shards outside of the default shard).

Comment by Robert Varga [ 24/Aug/17 ]

This issue will not be fixed for DataChangeListeners, since they are deprecated. Underlying issue is addressed in the MD-SAL's Consumer APIs, which properly assemble changes from a shard hierarchy, supporting listening on root (as it no longer is special).

Generated at Wed Feb 07 19:55:28 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.