BUG-5280: do not cache modify responses 79/48979/5
authorRobert Varga <rovarga@cisco.com>
Mon, 5 Dec 2016 10:56:04 +0000 (11:56 +0100)
committerTom Pantelis <tpanteli@brocade.com>
Mon, 12 Dec 2016 13:13:04 +0000 (13:13 +0000)
Modification responses cannot be cached, as their sequence
number is changing -- which leads to cached responses being
dropped.

Change-Id: I3c4037e3a29cff3cdd193865cd98f5df152286f4
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/FrontendTransaction.java

index a825a4d..9240aab 100644 (file)
@@ -73,7 +73,6 @@ final class FrontendTransaction {
     private long expectedSequence;
 
     private ReadWriteShardDataTreeTransaction openTransaction;
-    private ModifyTransactionSuccess cachedModifySuccess;
     private DataTreeModification sealedModification;
     private ShardDataTreeCohort readyCohort;
 
@@ -361,11 +360,7 @@ final class FrontendTransaction {
     }
 
     private ModifyTransactionSuccess replyModifySuccess(final long sequence) {
-        if (cachedModifySuccess == null) {
-            cachedModifySuccess = new ModifyTransactionSuccess(id, sequence);
-        }
-
-        return recordSuccess(sequence, cachedModifySuccess);
+        return recordSuccess(sequence, new ModifyTransactionSuccess(id, sequence));
     }
 
     private @Nullable TransactionSuccess<?> handleModifyTransaction(final ModifyTransactionRequest request,