Make sure we purge transaction on abort 39/81939/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:26 +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>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java

index 98b02432e516b045fbf957d1f6ec065ee1726ccb..897527764c18b2ae26061b014ac22e5e24ab4de5 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);
                 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)) {
             } else if (message instanceof MakeLeaderLocal) {
                 onMakeLeaderLocal();
             } else if (RESUME_NEXT_PENDING_TRANSACTION.equals(message)) {