Bug 2055: Handle Tx create in TransactionProxy resiliently 15/12215/7
authortpantelis <tpanteli@brocade.com>
Sun, 12 Oct 2014 14:44:35 +0000 (10:44 -0400)
committertpantelis <tpanteli@brocade.com>
Tue, 28 Oct 2014 09:08:02 +0000 (05:08 -0400)
commitc7636ed2c99ab891dbecb719db53c1a4ce1b54b8
tree20fbec1476027de4f955bb690be8cff8e5c820ce
parent15cc9c04c1a0c4f88f2a95957b378618855182ae
Bug 2055: Handle Tx create in TransactionProxy resiliently

    Modified TransactionProxy to utilize the FindPrimaryShard
functionality
    to wait until the shard is initialized. Also added retries to
    the CreateTransaction operation to wait a period of time for the
shard
    to elect a leader. This makes it more resilient to avoid transient
    timing/sequencing failures, particularly on startup.

    In addition, the FindPrimaryShard and CreateTransaction operations
are now
    done async (non-blocking). The futures are combined to yield the
    CreateTransactionReply which is passed to a new class
    TransactionFutureCallback on completion. The
TransactionFutureCallback
    class creates and stores the TransactionContext which subsequent
    read/write/delete/ready transaction operations can access. If a
    transaction operation occurs before CreateTransaction completes, the
    operation is cached in TransactionFutureCallback and executed when
    the CreateTransaction future completes.

Change-Id: Id9cdc9641038922d6209c44d924bd168658a71fb
Signed-off-by: tpantelis <tpanteli@brocade.com>
14 files changed:
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerRegistrationProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContext.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStore.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/TransactionProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/exceptions/NoShardLeaderException.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/ActorContext.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedConfigDataStoreProviderModule.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedOperationalDataStoreProviderModule.java
opendaylight/md-sal/sal-distributed-datastore/src/main/yang/distributed-datastore-provider.yang
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerRegistrationProxyTest.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/TransactionProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/InMemoryJournal.java