BUG 1712 - Distributed DataStore does not work properly with Transaction Chains 33/10833/8
authorMoiz Raja <moraja@cisco.com>
Fri, 5 Sep 2014 04:53:46 +0000 (21:53 -0700)
committerMoiz Raja <moraja@cisco.com>
Wed, 10 Sep 2014 11:31:46 +0000 (04:31 -0700)
commit47a2c420e5f271cb78ce10ea96883c17cc4b2cc9
tree8848e4526721c767116e16af6c2742bd7dcef0ab
parent25b805c6685467f561506dbb5187a744fc12096b
BUG 1712  - Distributed DataStore does not work properly with Transaction Chains

The fix is as follows,

1. When Creating a trasaction chain create a unique identifier for the transaction chain
   using the member name and the current timestamp

2. When a transaction is created using the transaction chain pass the transaction chain id
   along to the remote shard

3. If the remote shard receives a transaction with a valid transaction chain (one which is
   not empty) then it creates a new transaction chain if one does not exist. If one does exist
   then the Shard just creates a new transaction on the existing transaction chain.
   This way if a single transaction chai was used to create transactions on multiple
   different shards the a transaction chain would  be created on each one of those shards.

4. When a transaction chain is closed a Close Transaction Chain message is broadcast to all
   the Shards in the system. If those shards had a transaction chain with the specified id
   then the transaction chain would be closed. The sender does not care about receiving a
   response

5. When a state change occurs on a Shard we check if the Shard is not a leader. If that is
   the case we automatically close all existing transaction chains on that shard and clear
   the map which tracks the transaction chains for that shard

Change-Id: I6bcfb9de3d0ec666e4152afb69c702dda4f38171
Signed-off-by: Moiz Raja <moraja@cisco.com>
19 files changed:
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/protobuff/messages/transaction/ShardTransactionChainMessages.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/protobuff/messages/transaction/ShardTransactionMessages.java
opendaylight/md-sal/sal-clustering-commons/src/main/resources/ShardTransaction.proto
opendaylight/md-sal/sal-clustering-commons/src/main/resources/ShardTransactionChain.proto
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Configuration.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ConfigurationImpl.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.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/TransactionProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CloseTransactionChain.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/ActorContext.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/BasicIntegrationTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ConfigurationImplTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionChainTest.java [deleted file]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionChainProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/MockConfiguration.java