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 98b0243..8975277 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)) {

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.