Make sure we purge transaction on abort 40/81940/2
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 7 May 2019 11:22:10 +0000 (13:22 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 7 May 2019 12:12:34 +0000 (12:12 +0000)
In case of read-only transactions it is not sufficient to just
persist the abort payload, we need to also purge the transaction.

Change-Id: I8761040d074743b5a1c5eebbecc6449c30abe47e
JIRA: CONTROLLER-1879
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit bc301a153a07be7c23327e85179974422624c80a)

opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java

index 51ee4d7b80ef7c9396930984b22e44c18bbb392c..438d4d951825dc6036ff76ca13ce96facfa8aba7 100644 (file)
@@ -365,6 +365,7 @@ public class Shard extends RaftActor {
                 final TransactionIdentifier txId = ((PersistAbortTransactionPayload) message).getTransactionId();
                 persistPayload(txId, AbortTransactionPayload.create(
                         txId, datastoreContext.getInitialPayloadSerializedBufferCapacity()), true);
+                store.purgeTransaction(txId, null);
             } else if (message instanceof MakeLeaderLocal) {
                 onMakeLeaderLocal();
             } else if (RESUME_NEXT_PENDING_TRANSACTION.equals(message)) {