BUG-5280: Close client history after all histories are closed 37/54037/9
authorIvan Hrasko <ivan.hrasko@pantheon.tech>
Wed, 29 Mar 2017 13:51:33 +0000 (15:51 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Sat, 1 Apr 2017 08:43:41 +0000 (08:43 +0000)
Make sure record history state as closed once we are done with
it.

Change-Id: Icbdf947ad166b082e06df896741e618e801ecf2e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHistory.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java

index a3afa22c26a7e384050b669cb199a1fa92edce9c..c15c7c85f2e1edf52fb37614ea9da9816119eaec 100644 (file)
@@ -88,6 +88,7 @@ public abstract class AbstractClientHistory extends LocalAbortable implements Id
         if (local != State.CLOSED) {
             Preconditions.checkState(local == State.IDLE, "Local history %s has an open transaction", this);
             histories.values().forEach(ProxyHistory::close);
         if (local != State.CLOSED) {
             Preconditions.checkState(local == State.IDLE, "Local history %s has an open transaction", this);
             histories.values().forEach(ProxyHistory::close);
+            updateState(local, State.CLOSED);
         }
     }
 
         }
     }
 
index 11379a0bf25efb88db839e2c54dfbcc9f32da784..a8fc8eeceeee6d013d289fd149e6714652e911c1 100644 (file)
@@ -1002,9 +1002,6 @@ public class DistributedDataStoreIntegrationTest {
 
     @Test
     public void testCreateChainedTransactionAfterClose() throws Exception {
 
     @Test
     public void testCreateChainedTransactionAfterClose() throws Exception {
-        //TODO remove when test passes also for ClientBackedDataStore
-        Assume.assumeTrue(testParameter.equals(DistributedDataStore.class));
-
         new IntegrationTestKit(getSystem(), datastoreContextBuilder) {
             {
                 try (AbstractDataStore dataStore = setupAbstractDataStore(
         new IntegrationTestKit(getSystem(), datastoreContextBuilder) {
             {
                 try (AbstractDataStore dataStore = setupAbstractDataStore(
@@ -1023,9 +1020,6 @@ public class DistributedDataStoreIntegrationTest {
 
     @Test
     public void testChainWithReadOnlyTxAfterPreviousReady() throws Exception {
 
     @Test
     public void testChainWithReadOnlyTxAfterPreviousReady() throws Exception {
-        //TODO remove when test passes also for ClientBackedDataStore
-        Assume.assumeTrue(testParameter.equals(DistributedDataStore.class));
-
         new IntegrationTestKit(getSystem(), datastoreContextBuilder) {
             {
                 try (final AbstractDataStore dataStore = setupAbstractDataStore(
         new IntegrationTestKit(getSystem(), datastoreContextBuilder) {
             {
                 try (final AbstractDataStore dataStore = setupAbstractDataStore(
@@ -1165,9 +1159,6 @@ public class DistributedDataStoreIntegrationTest {
 
     @Test
     public void testChangeListenerRegistration() throws Exception {
 
     @Test
     public void testChangeListenerRegistration() throws Exception {
-        //TODO remove when test passes also for ClientBackedDataStore
-        Assume.assumeTrue(testParameter.equals(DistributedDataStore.class));
-
         new IntegrationTestKit(getSystem(), datastoreContextBuilder) {
             {
                 try (final AbstractDataStore dataStore = setupAbstractDataStore(
         new IntegrationTestKit(getSystem(), datastoreContextBuilder) {
             {
                 try (final AbstractDataStore dataStore = setupAbstractDataStore(