Bug 6587: Retain state when transitioning between Leader and IsolatedLeader 70/44970/1
authorTom Pantelis <tpanteli@brocade.com>
Wed, 31 Aug 2016 04:55:57 +0000 (00:55 -0400)
committerTom Pantelis <tpanteli@brocade.com>
Thu, 1 Sep 2016 02:58:02 +0000 (02:58 +0000)
commit8d865c6d69a4f5171162d8a8d84980600423c49d
tree6b7f2ccadfe49fb802cdcbe25bcc82e32188100c
parentb3d6b930fa57d225c8c778dc09e5971e0c4f9ef7
Bug 6587: Retain state when transitioning between Leader and IsolatedLeader

If there's a transaction in the COMMIT_PENDING state, ie it has been persisted and
is in the process of being replicated, and the Leader switches to IsolatedLeader, the
ClientRequestTracker state is lost. As a result when the follower(s) come back and
replication consensus is achieved and the tx is applied to state, the tx ID isn't
available and the ShardDataTree applies it as a foreign candidate, leaving the
tx in the pending queue. This prevents subsequent transactions from making progress.

To fix this, we need to retain/copy the internal leader state when transitioning
between Leader and IsolatedLeader.

Change-Id: If06996dccf083fd5d37757fd91fde2eb0eb82ea1
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
(cherry picked from commit a0b8be5ce48c0d1e0b573d1952211913c58d4935)
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeader.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractRaftActorBehavior.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/IsolatedLeader.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Leader.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreRemotingIntegrationTest.java