Bug 4774: Wait for prior RO tx creates on tx chain 17/31817/1
authorTom Pantelis <tpanteli@brocade.com>
Mon, 14 Dec 2015 23:27:10 +0000 (18:27 -0500)
committerTom Pantelis <tpanteli@brocade.com>
Wed, 23 Dec 2015 11:55:02 +0000 (11:55 +0000)
commit5aeeb2a2184570e666c97039037314b81c8dd1ae
tree6606c3f9ee8555086ecddcd5ea09096873e62716
parent1d58d3c610d5341dcd1133967563eed56b864aba
Bug 4774: Wait for prior RO tx creates on tx chain

Added a priorReadOnlyTxPromises map to TransactionChainProxy that holds
Promise instances for each read-only tx. When the parent class completes
the primary shard lookup and creates the TransactionContext (either success or
failure), onTransactionContextCreated is called which completes the Promise. A
write tx that is created prior to completion will wait on the Promise's Future via
findPrimaryShard.

Change-Id: Ib1a620cfd5be3e38f633b3faf9ef7a31abaaf345
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
(cherry picked from commit 86a3188d6db1e7da2803a6b36daa2898fe045e45)
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionContextFactory.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionChainProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionContextFactory.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java