Bug 8116 - Make DistributedShardChangePublisher agnostic to data tree change events... 61/56061/2
authorJakub Morvay <jmorvay@cisco.com>
Mon, 24 Apr 2017 13:21:29 +0000 (15:21 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Thu, 27 Apr 2017 10:56:33 +0000 (10:56 +0000)
commit29bf93e69775a56c9cb22bb91fb1e388155465af
treef48acdda833a8c80b7d67798d699b741c3d1cf23
parentdf6a0ca1162297db24a147b68efa71cb80a617fd
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>
(cherry picked from commit b73d37a30e750c6ef7a6f6614f3b00a01b1fdd4c)
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