Bug 8116 - Make DistributedShardChangePublisher agnostic to data tree change events... 21/55921/3
authorJakub Morvay <jmorvay@cisco.com>
Mon, 24 Apr 2017 13:21:29 +0000 (15:21 +0200)
committerJakub Morvay <jmorvay@cisco.com>
Mon, 24 Apr 2017 21:50:27 +0000 (21:50 +0000)
commitb73d37a30e750c6ef7a6f6614f3b00a01b1fdd4c
tree81bee4c77b560972c16fc306bc8738c5ebe2b45a
parent6f80fcdc491f11de11d45447107ad2edce054af5
Bug 8116 - Make DistributedShardChangePublisher agnostic to data tree change events ordering

DistributedShardChangePublisher allows for registering DCTLs on
DistributedShardFrontend. Internally, DistributedShardChangePublisher
sets up DataTreeChangeListenerProxies on respective backend shard and
also on all of its backend subshards. Upon receiving data tree change
events from backend shards, DistributedShardChangePublisher updates
its own data tree. With the help of this tree, it finally constructs
data tree chnage events for registered DCTLs.

DistributedShardChangePublisher relies on specific ordering of backend
shards data tree change events. If it receives subshard's data tree
change event prior to current shard data tree change event, updating
internal data tree can fail. Subshard's data tree change event can
expect some changes from its parent shard.

Clearly, we don't have control on ordering of these events. Do not rely
on this. If we cannot apply subshard's change to data tree, cache it
and try to apply it once we have also its parent's change.

Change-Id: I3bd9b2d217d01974bce02465529c6cdbf8c3d633
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/sharding/DistributedShardChangePublisher.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/sharding/DistributedShardedDOMDataTreeTest.java