Bug 1576: Handle remote failures for write Tx async 09/10109/6
authortpantelis <tpanteli@brocade.com>
Sun, 17 Aug 2014 07:36:47 +0000 (03:36 -0400)
committertpantelis <tpanteli@brocade.com>
Sat, 23 Aug 2014 14:09:32 +0000 (10:09 -0400)
commit39d81b37e75f8e38eab7ac1d6c606e704265fd9c
treef2b3f5b6b117e921966e0098827613893e687a72
parent84aeaab115138639ddde496da607550640015ec5
Bug 1576: Handle remote failures for write Tx async

TransactionProxy
  - Modified TransactionContextImpl to cache Futures from put/merge/delete
    ask operations.

  - On ready, combine all previous cached Futures and the
    ReadyTransactionReply Future and transform to one Future that
    extracts the cohort actor path from the ReadyTransactionReply. Any
    Future failure results in a failed cohort actor path Future with
    the cause propagated.

  - The cohort actor path Future gets passed to the ThreePhaseCommitCohortProxy.

  - Modified read and exists methods to also wait and verify async any
    previous cached put/merge/delete Futures.

ThreePhaseCommitCohortProxy
  - On canCommit, it first asynchronously builds the list of cohort actor
    paths from the Futures passed from the TransactionProxy. If any
    cohort path FUture fails, canCommit fails and propgates the failure
    cause.

Added extensive unit tests for both classes to cover all cases.

Change-Id: Ib9794797a654a92c305fd8cc3db2c1147a363b5c
Signed-off-by: tpantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionProxyTest.java